From 005e39a2aab88d47044fa2108a6d04bd490b169e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 25 Jan 2011 13:23:24 +0100 Subject: 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 --- qmake/project.cpp | 11 ++++++----- 1 file 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; } } -- cgit v0.12