mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-07 11:36:18 +02:00
Merge pull request #245 from lioncash/earlyexit
stringutil: Add early-exit case to ReplaceAll
This commit is contained in:
commit
0f490c8eb5
1 file changed
+4
@@ -230,6 +230,10 @@ void SplitString(const std::string& str, const char delim, std::vector<std::stri
|
||||
std::string ReplaceAll(std::string result, const std::string& src, const std::string& dest)
|
||||
{
|
||||
size_t pos = 0;
|
||||
|
||||
if (src == dest)
|
||||
return result;
|
||||
|
||||
while(1)
|
||||
{
|
||||
pos = result.find(src, pos);
|
||||
|
||||
Reference in new issue
Block a user