summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-01-25 12:23:24 (GMT)
committerOswald Buddenhagen <oswald.buddenhagen@nokia.com>2011-01-25 19:37:31 (GMT)
commit005e39a2aab88d47044fa2108a6d04bd490b169e (patch)
treee8ee7103dc9a7e1748a754bd5c11d3f8e1995371 /qmake
parent1f28efe4125397f2a61af421dbeb9f6954ca2a9c (diff)
downloadQt-005e39a2aab88d47044fa2108a6d04bd490b169e.zip
Qt-005e39a2aab88d47044fa2108a6d04bd490b169e.tar.gz
Qt-005e39a2aab88d47044fa2108a6d04bd490b169e.tar.bz2
cleanup split_arg_list() some more
unify the code paths for last and intermediate arguments. as a side effect, this should be somewhat more efficient. Reviewed-by: mariusSO
Diffstat (limited to 'qmake')
-rw-r--r--qmake/project.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/qmake/project.cpp b/qmake/project.cpp
index d690770..7951d11 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -249,10 +249,9 @@ static QStringList split_arg_list(QString params)
++last;
for(int x = last, parens = 0; ; x++) {
if(x == params_len) {
- while(x && params_data[x-1].unicode() == SPACE)
+ while(x > last && params_data[x-1].unicode() == SPACE)
--x;
- QString mid(params_data+last, x-last);
- args << mid;
+ args << params.mid(last, x - last);
return args;
}
ushort unicode = params_data[x].unicode();
@@ -266,9 +265,11 @@ static QStringList split_arg_list(QString params)
quote = unicode;
}
if(!parens && !quote && unicode == COMMA) {
- QString mid = params.mid(last, x - last).trimmed();
- args << mid;
+ int prev = last;
last = x+1;
+ while(x > prev && params_data[x-1].unicode() == SPACE)
+ --x;
+ args << params.mid(prev, x - prev);
break;
}
}