summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/RiivolutionPatcher.cpp
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2023-01-24 21:51:15 +0100
committerGitHub <noreply@github.com>2023-01-24 21:51:15 +0100
commit4b2c00e239f44e79190cc156e4557ea4aaf64bd2 (patch)
tree09ec8ac31ff935d63aa9c06004802156ac96ebf5 /Source/Core/DiscIO/RiivolutionPatcher.cpp
parentba6ee9d7ba9730e5b2165ff0ee18cbc23762b129 (diff)
parente5b91f00b0688d5cba6870da6d6ad3300097b07f (diff)
Merge pull request #11487 from lioncash/str
Common: Replace StringBeginsWith/StringEndsWith with std equivalents
Diffstat (limited to 'Source/Core/DiscIO/RiivolutionPatcher.cpp')
-rw-r--r--Source/Core/DiscIO/RiivolutionPatcher.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/RiivolutionPatcher.cpp b/Source/Core/DiscIO/RiivolutionPatcher.cpp
index 840acf768b..eb0ca53137 100644
--- a/Source/Core/DiscIO/RiivolutionPatcher.cpp
+++ b/Source/Core/DiscIO/RiivolutionPatcher.cpp
@@ -64,13 +64,13 @@ FileDataLoaderHostFS::MakeAbsoluteFromRelative(std::string_view external_relativ
return std::nullopt;
#endif
- std::string result = StringBeginsWith(external_relative_path, "/") ? m_sd_root : m_patch_root;
+ std::string result = external_relative_path.starts_with('/') ? m_sd_root : m_patch_root;
std::string_view work = external_relative_path;
// Strip away all leading and trailing path separators.
- while (StringBeginsWith(work, "/"))
+ while (work.starts_with('/'))
work.remove_prefix(1);
- while (StringEndsWith(work, "/"))
+ while (work.ends_with('/'))
work.remove_suffix(1);
size_t depth = 0;
while (true)
@@ -126,7 +126,7 @@ FileDataLoaderHostFS::MakeAbsoluteFromRelative(std::string_view external_relativ
work = work.substr(separator_position + 1);
// Remove any potential extra path separators.
- while (StringBeginsWith(work, "/"))
+ while (work.starts_with('/'))
work = work.substr(1);
}
return result;
@@ -425,9 +425,9 @@ static void ApplyFolderPatchToFST(const Patch& patch, const Folder& folder,
return std::string(b);
if (b.empty())
return std::string(a);
- if (StringEndsWith(a, "/"))
+ if (a.ends_with('/'))
a.remove_suffix(1);
- if (StringBeginsWith(b, "/"))
+ if (b.starts_with('/'))
b.remove_prefix(1);
return fmt::format("{}/{}", a, b);
};