From e5b91f00b0688d5cba6870da6d6ad3300097b07f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Tue, 24 Jan 2023 14:25:49 -0500 Subject: Common: Replace StringBeginsWith/StringEndsWith with std equivalents Obsoletes these functions in favor of the standard member functions added in C++20. --- Source/Core/DiscIO/RiivolutionParser.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Source/Core/DiscIO/RiivolutionParser.cpp') diff --git a/Source/Core/DiscIO/RiivolutionParser.cpp b/Source/Core/DiscIO/RiivolutionParser.cpp index dacbbbcfc5..656cd20697 100644 --- a/Source/Core/DiscIO/RiivolutionParser.cpp +++ b/Source/Core/DiscIO/RiivolutionParser.cpp @@ -53,7 +53,7 @@ static std::vector ReadHexString(std::string_view sv) { if ((sv.size() % 2) == 1) return {}; - if (StringBeginsWith(sv, "0x") || StringBeginsWith(sv, "0X")) + if (sv.starts_with("0x") || sv.starts_with("0X")) sv = sv.substr(2); std::vector result; @@ -245,7 +245,7 @@ bool Disc::IsValidForGame(const std::string& game_id, std::optional revisio const int disc_number_int = std::optional(disc_number).value_or(-1); const int revision_int = std::optional(revision).value_or(-1); - if (m_game_filter.m_game && !StringBeginsWith(game_id_full, *m_game_filter.m_game)) + if (m_game_filter.m_game && !game_id_full.starts_with(*m_game_filter.m_game)) return false; if (m_game_filter.m_developer && game_developer != *m_game_filter.m_developer) return false; @@ -276,7 +276,7 @@ std::vector Disc::GeneratePatches(const std::string& game_id) const bool replaced = false; for (const auto& r : replacements) { - if (StringBeginsWith(sv, r.first)) + if (sv.starts_with(r.first)) { for (char c : r.second) result.push_back(c); -- cgit v1.2.3