make unescapeFilePath() less inefficient

replace() doesn't detach if there is nothing to do.

Change-Id: I845b585c766f44a670ca3af1fc11ba03e7317622
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
This commit is contained in:
Oswald Buddenhagen 2013-07-17 16:44:18 +02:00 committed by The Qt Project
parent cc0c394682
commit 944e1d7b6a

View File

@ -2763,12 +2763,8 @@ QString
MakefileGenerator::unescapeFilePath(const QString &path) const
{
QString ret = path;
if(!ret.isEmpty()) {
if(ret.contains(QLatin1String("\\ ")))
ret.replace(QLatin1String("\\ "), QLatin1String(" "));
if(ret.contains(QLatin1Char('\"')))
ret.remove(QLatin1Char('\"'));
}
ret.replace(QLatin1String("\\ "), QLatin1String(" "));
ret.remove(QLatin1Char('\"'));
return ret;
}