Use slice method where applicable

These code segments already have its boundary checked and can thus be faster.

PR #22411.
This commit is contained in:
Chocobo1
2025-03-15 14:58:59 +08:00
committed by GitHub
parent d174bc75e4
commit 5a4b3b25d3
23 changed files with 113 additions and 63 deletions

View File

@@ -64,7 +64,7 @@ int Utils::Compare::naturalCompare(const QString &left, const QString &right, co
const int start = pos;
while ((pos < str.size()) && str[pos].isDigit())
++pos;
return str.mid(start, (pos - start));
return str.sliced(start, (pos - start));
};
const QStringView numViewL = numberView(left, posL);