summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-03-30 13:19:03 +0300
committerAnton Kudryavtsev <a.kudryavtsev@netris.ru>2016-06-08 06:24:08 +0000
commit7a4ce3cbccbdce920f3e0d0f82fe9d707d50f393 (patch)
treefa3cf9587341b51497095b309ef18300a9d1bd0e /src/corelib/tools
parentcd21da392216f7af6680695dd1b02e6397b72cb3 (diff)
QString: remove unnecessary copy in replace()
When a copy is needed, replace_helper() takes care of that for us. Change-Id: I9e5c89cb70b2902c96062a9edaf77fedda6ddb2c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qstring.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 940fd5817b..cf36be1f7c 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -2346,8 +2346,7 @@ QString &QString::remove(QChar ch, Qt::CaseSensitivity cs)
*/
QString &QString::replace(int pos, int len, const QString &after)
{
- QString copy = after;
- return replace(pos, len, copy.constData(), copy.length());
+ return replace(pos, len, after.constData(), after.length());
}
/*!