Drop static caching of result of QDir::separator(), no real gain

GIT_SILENT
parent 9c2057f8
......@@ -68,7 +68,6 @@ const bool separateThreadForHighPriority = true;
*/
QString elidedPathLeft(const QString& path, int width)
{
static const QChar separator = QDir::separator();
static const QString placeholder = QStringLiteral("...");
if (path.size() <= width) {
......@@ -76,7 +75,7 @@ QString elidedPathLeft(const QString& path, int width)
}
int start = (path.size() - width) + placeholder.size();
int pos = path.indexOf(separator, start);
int pos = path.indexOf(QDir::separator(), start);
if (pos == -1) {
pos = start; // no separator => just cut off the path at the beginning
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment