From 17dcb835103ac05012c5a7eafa8c7702cef53390 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 11 Mar 2013 18:09:33 +0300 Subject: Add some fixes after automatic checks. --- src/utils/stringutils.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/utils/stringutils.cpp') diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 3378ec132..1994cda98 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -207,12 +207,11 @@ size_t findI(std::string str, std::string subStr) size_t findI(std::string text, StringVect &list) { std::string str = toLower(text); - size_t idx; FOR_EACH (StringVectCIter, i, list) { std::string subStr = *i; subStr = toLower(subStr); - idx = str.find(subStr); + const size_t idx = str.find(subStr); if (idx != std::string::npos) return idx; } @@ -375,11 +374,10 @@ bool getBoolFromString(const std::string &text) void replaceSpecialChars(std::string &text) { - size_t idx = 0; size_t pos1 = text.find("&"); while (pos1 != std::string::npos) { - idx = pos1 + 1; + const size_t idx = pos1 + 1; if (idx >= text.size()) break; -- cgit v1.2.3-70-g09d2