From cdf1521258ae618c0f42b8a339551495aa0d2003 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Wed, 2 Sep 2015 17:06:19 +0300 Subject: [PATCH] Further fix search replace --- lib/errorlogger.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/lib/errorlogger.cpp b/lib/errorlogger.cpp index 3b102ba17..f0f441f1e 100644 --- a/lib/errorlogger.cpp +++ b/lib/errorlogger.cpp @@ -302,14 +302,7 @@ void ErrorLogger::ErrorMessage::findAndReplace(std::string &source, const std::s std::string::size_type index = 0; while ((index = source.find(searchFor, index)) != std::string::npos) { source.replace(index, searchFor.length(), replaceWith); - - std::string::size_type advanceBy; - if (searchFor.length() >= replaceWith.length()) - advanceBy = replaceWith.length(); - else - advanceBy = (replaceWith.length() - searchFor.length()) + 1; - - index += advanceBy; + index += replaceWith.length(); } }