Merge branch 'main' into feature/universal_mac

This commit is contained in:
SoftFever 2025-03-27 22:52:51 +08:00 committed by GitHub
commit b66aff84de
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,7 +39,10 @@ std::set<std::string> SplitStringAndRemoveDuplicateElement(const std::string &st
void ReplaceString(std::string &resource_str, const std::string &old_str, const std::string &new_str) void ReplaceString(std::string &resource_str, const std::string &old_str, const std::string &new_str)
{ {
std::string::size_type pos = 0; std::string::size_type pos = 0;
while ((pos = resource_str.find(old_str)) != std::string::npos) { resource_str.replace(pos, old_str.length(), new_str); } while ((pos = resource_str.find(old_str, pos)) != std::string::npos) {
resource_str.replace(pos, old_str.length(), new_str);
pos += new_str.length(); //advance position to continue after replacement
}
} }
} }