remove string wrappers

This commit is contained in:
nmzik
2026-09-17 19:50:03 +04:00
parent cc8e02380f
commit 2bf78a94e0
10 changed files with 1099 additions and 1394 deletions
+5 -5
View File
@@ -51,17 +51,17 @@ static bool TryGetTitleIdFromContentId(std::string* title_id) {
return false;
}
const uint32_t dash = Common::FindIndex(content_id, '-');
if (!Common::IndexValid(content_id, dash)) {
const auto dash = content_id.find('-');
if (dash == std::string::npos) {
return false;
}
const uint32_t underscore = Common::FindIndex(content_id, '_', dash + 1);
if (!Common::IndexValid(content_id, underscore) || underscore <= dash + 1) {
const auto underscore = content_id.find('_', dash + 1);
if (underscore == std::string::npos || underscore <= dash + 1) {
return false;
}
*title_id = Common::Mid(content_id, dash + 1, underscore - dash - 1);
*title_id = content_id.substr(dash + 1, underscore - dash - 1);
return !title_id->empty();
}
+1 -1
View File
@@ -376,7 +376,7 @@ int KYTY_SYSV_ABI SaveDataDirNameSearch(const SaveDataDirNameSearchCond* cond,
if (Common::File::IsDirectoryExisting(root)) {
for (const auto& entry: Common::File::GetDirEntries(root)) {
if (!entry.is_file && entry.name != "." && entry.name != ".." &&
!Common::StartsWith(entry.name, "sce_")) {
!entry.name.starts_with("sce_")) {
if (cond->dir_name == nullptr || cond->dir_name->data[0] == '\0' ||
dir_name_match(Common::ToLower(entry.name).c_str(),
Common::ToLower(std::string(cond->dir_name->data)).c_str())) {