forked from qt-creator/qt-creator
Utils: Avoid copy on FileName::toString()
Takes ~6% of project loading Change-Id: Id277f6cc9d5666b9a383419959cfd37b936437f8 Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
25096de511
commit
736168497a
@@ -548,9 +548,9 @@ QFileInfo FileName::toFileInfo() const
|
||||
}
|
||||
|
||||
/// \returns a QString for passing on to QString based APIs
|
||||
QString FileName::toString() const
|
||||
const QString &FileName::toString() const
|
||||
{
|
||||
return QString(*this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/// \returns a QString to display to the user
|
||||
|
@@ -71,7 +71,7 @@ public:
|
||||
static FileName fromLatin1(const QByteArray &filename);
|
||||
static FileName fromUserInput(const QString &filename);
|
||||
static FileName fromUtf8(const char *filename, int filenameSize = -1);
|
||||
QString toString() const;
|
||||
const QString &toString() const;
|
||||
QString toUserOutput() const;
|
||||
QString fileName(int pathComponents = 0) const;
|
||||
bool exists() const;
|
||||
|
Reference in New Issue
Block a user