Common: Replace StringBeginsWith/StringEndsWith with std equivalents

Obsoletes these functions in favor of the standard member functions
added in C++20.
This commit is contained in:
Lioncash
2023-01-24 14:25:49 -05:00
parent ba6ee9d7ba
commit e5b91f00b0
21 changed files with 57 additions and 97 deletions

View File

@ -171,7 +171,7 @@ bool Delete(const std::string& filename, IfAbsentBehavior behavior)
DEBUG_LOG_FMT(COMMON, "Delete: file {}", filename);
#ifdef ANDROID
if (StringBeginsWith(filename, "content://"))
if (filename.starts_with("content://"))
{
const bool success = DeleteAndroidContent(filename);
if (!success)
@ -1054,7 +1054,7 @@ void SetUserPath(unsigned int dir_index, std::string path)
#endif
// Directories should end with a separator, files should not.
while (StringEndsWith(path, "/"))
while (path.ends_with('/'))
path.pop_back();
if (path.empty())
return;