summaryrefslogtreecommitdiffstats
path: root/qmake/generators/makefile.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2014-11-13 18:02:02 +0100
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2015-02-02 11:14:57 +0000
commit2b31356ac9faaa3ad9522d3e8b0dd00d90877476 (patch)
treec181c4c04458912f358fcfcbae4b817426f3c213 /qmake/generators/makefile.cpp
parenteb9db750e9549cb4ef35d46b3dbf432c5442dd6c (diff)
optimize filePrefixRoot()
more efficient use of string functions. Change-Id: I3d95d6379eaab025b18449b706f93631a2132aad Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qmake/generators/makefile.cpp')
-rw-r--r--qmake/generators/makefile.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index d2b11aaa01..5d9ce7af08 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -1190,11 +1190,13 @@ MakefileGenerator::writeObj(QTextStream &t, const char *src)
QString
MakefileGenerator::filePrefixRoot(const QString &root, const QString &path)
{
- QString ret(root + path);
+ QString ret(path);
if(path.length() > 2 && path[1] == ':') //c:\foo
- ret = QString(path.mid(0, 2) + root + path.mid(2));
- while(ret.endsWith("\\"))
- ret = ret.left(ret.length()-1);
+ ret.insert(2, root);
+ else
+ ret.prepend(root);
+ while (ret.endsWith('\\'))
+ ret.chop(1);
return ret;
}