mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-20 10:56:58 +02:00
remove string wrappers
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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())) {
|
||||
|
||||
Reference in New Issue
Block a user