diff options
author | Jędrzej Nowacki <jedrzej.nowacki@digia.com> | 2014-01-15 17:09:39 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-15 17:21:25 +0100 |
commit | 0f62c3b6d48928710e2ac5c73cd4b69b8f423a87 (patch) | |
tree | 05c3390d653aaac95d3422c1083c69e0b13f8ed5 | |
parent | 494882adadb33ffb7a7a9b2fa9356362df87d3bf (diff) | |
download | qtxmlpatterns-0f62c3b6d48928710e2ac5c73cd4b69b8f423a87.tar.gz qtxmlpatterns-0f62c3b6d48928710e2ac5c73cd4b69b8f423a87.tar.bz2 qtxmlpatterns-0f62c3b6d48928710e2ac5c73cd4b69b8f423a87.zip |
Minor optimization, use QStringRef over QString
That way we avoid some unnecessary memory allocations
Change-Id: I597443393671d57b1a47b37eb15c3eca54ee4168
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
-rw-r--r-- | tools/xmlpatterns/qapplicationargumentparser.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/xmlpatterns/qapplicationargumentparser.cpp b/tools/xmlpatterns/qapplicationargumentparser.cpp index 9bf407b..031e088 100644 --- a/tools/xmlpatterns/qapplicationargumentparser.cpp +++ b/tools/xmlpatterns/qapplicationargumentparser.cpp @@ -464,7 +464,7 @@ QString QApplicationArgumentParserPrivate::lineWrap(const QString &input, return input; int from = wrapFinder.toPreviousBoundary(); - output.append(input.left(from)); + output.append(input.leftRef(from)); while(true) { @@ -476,7 +476,7 @@ QString QApplicationArgumentParserPrivate::lineWrap(const QString &input, output.append(QLatin1Char('\n')); output.append(indent); - output.append(input.mid(from, currentWidthPos - from).trimmed()); + output.append(input.midRef(from, currentWidthPos - from).trimmed().toString()); from += (currentWidthPos - from); } else @@ -484,7 +484,7 @@ QString QApplicationArgumentParserPrivate::lineWrap(const QString &input, /* Append the remains. */ output.append(QLatin1Char('\n')); output.append(indent); - output.append(input.mid(from).trimmed()); + output.append(input.midRef(from).trimmed().toString()); break; } } |