From 3237a0799658a6a1da0adaf9af4920b80ea148a1 Mon Sep 17 00:00:00 2001
From: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Date: Tue, 14 Jul 2009 20:40:01 +0200
Subject: [PATCH] move actual replaceInList imlementation back to
 proparserutils.h

---
 src/shared/proparser/profileevaluator.cpp | 18 ------------------
 src/shared/proparser/proparserutils.h     | 21 +++++++--------------
 2 files changed, 7 insertions(+), 32 deletions(-)

diff --git a/src/shared/proparser/profileevaluator.cpp b/src/shared/proparser/profileevaluator.cpp
index 58f75baf064..4d2981f0f80 100644
--- a/src/shared/proparser/profileevaluator.cpp
+++ b/src/shared/proparser/profileevaluator.cpp
@@ -790,24 +790,6 @@ ProItem::ProItemReturn ProFileEvaluator::Private::visitEndProFile(ProFile * pro)
     return ProItem::ReturnTrue;
 }
 
-static void replaceInList(QStringList *varlist,
-        const QRegExp &regexp, const QString &replace, bool global)
-{
-    for (QStringList::Iterator varit = varlist->begin(); varit != varlist->end(); ) {
-        if ((*varit).contains(regexp)) {
-            (*varit).replace(regexp, replace);
-            if ((*varit).isEmpty())
-                varit = varlist->erase(varit);
-            else
-                ++varit;
-            if(!global)
-                break;
-        } else {
-            ++varit;
-        }
-    }
-}
-
 void ProFileEvaluator::Private::visitProValue(ProValue *value)
 {
     PRE(value);
diff --git a/src/shared/proparser/proparserutils.h b/src/shared/proparser/proparserutils.h
index 35124796d54..81d026b7beb 100644
--- a/src/shared/proparser/proparserutils.h
+++ b/src/shared/proparser/proparserutils.h
@@ -133,19 +133,14 @@ static void removeEach(QHash<QString, QStringList> *map,
         sl.removeAll(str);
 }
 
-/*
-  See ProFileEvaluator::Private::visitProValue(...)
-
-static QStringList replaceInList(const QStringList &varList, const QRegExp &regexp,
-                           const QString &replace, bool global)
+static void replaceInList(QStringList *varlist,
+        const QRegExp &regexp, const QString &replace, bool global)
 {
-    QStringList resultList = varList;
-
-    for (QStringList::Iterator varit = resultList.begin(); varit != resultList.end();) {
-        if (varit->contains(regexp)) {
-            *varit = varit->replace(regexp, replace);
-            if (varit->isEmpty())
-                varit = resultList.erase(varit);
+    for (QStringList::Iterator varit = varlist->begin(); varit != varlist->end(); ) {
+        if ((*varit).contains(regexp)) {
+            (*varit).replace(regexp, replace);
+            if ((*varit).isEmpty())
+                varit = varlist->erase(varit);
             else
                 ++varit;
             if (!global)
@@ -154,9 +149,7 @@ static QStringList replaceInList(const QStringList &varList, const QRegExp &rege
             ++varit;
         }
     }
-    return resultList;
 }
-*/
 
 inline QString fixEnvVariables(const QString &x)
 {
-- 
GitLab