Merge pull request #245 from lioncash/earlyexit

stringutil: Add early-exit case to ReplaceAll
This commit is contained in:
Henrik Rydgård committed 2014-12-08 21:41:47 +01:00
commit 0f490c8eb5
1 file changed
+4
+4
View File
@@ -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);