diff options
| author | hjk <hjk@qt.io> | 2025-11-12 16:51:34 +0100 |
|---|---|---|
| committer | hjk <hjk@qt.io> | 2025-11-13 09:42:00 +0000 |
| commit | 690ff4bacd922436bf308ea399d3f0ee80d42fcc (patch) | |
| tree | 8ae30efa372ad5b65ec261be110b9b1ebfe1b326 /src/plugins/git/gitclient.cpp | |
| parent | fadbd348a516f16b25863e2e04f14be2effda0a8 (diff) | |
Use QString::size() instead QString::length()
Minor gain in debug builds and when stepping.
Change-Id: I2540d309661e4babfd7331b068c17657ded2a098
Reviewed-by: David Schulz <david.schulz@qt.io>
Diffstat (limited to 'src/plugins/git/gitclient.cpp')
| -rw-r--r-- | src/plugins/git/gitclient.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 09f91c5f743..ca5900c66fa 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -459,7 +459,7 @@ ShowController::ShowController(IDocument *document, const QString &id) if (result == DoneWith::Success) { const QString remotePrefix = "remotes/"; const QString localPrefix = "<Local>"; - const int prefixLength = remotePrefix.length(); + const int prefixLength = remotePrefix.size(); QStringList branches; QString previousRemote = localPrefix; bool first = true; @@ -1456,7 +1456,7 @@ QStringList GitClient::setupCheckoutArguments(const FilePath &workingDirectory, if (singleRef.startsWith(refSha)) { // branch name might be origin/foo/HEAD if (!singleRef.endsWith(head) || singleRef.count('/') > 1) { - remoteBranch = singleRef.mid(refSha.length() + 1); + remoteBranch = singleRef.mid(refSha.size() + 1); if (remoteBranch == ref) break; } @@ -1805,7 +1805,7 @@ QString GitClient::synchronousShortDescription(const FilePath &workingDirectory, QString output = synchronousShortDescription(workingDirectory, revision, defaultShortLogFormat); output.replace(quoteReplacement, "\""); if (output != revision) { - if (output.length() > maxShortLogLength) { + if (output.size() > maxShortLogLength) { output.truncate(maxShortLogLength); output.append("..."); } @@ -2125,7 +2125,7 @@ QMap<QString,QString> GitClient::synchronousRemotesList(const FilePath &workingD const int tabIndex = remote.indexOf('\t'); if (tabIndex == -1) continue; - const QString url = remote.mid(tabIndex + 1, remote.length() - tabIndex - 8); + const QString url = remote.mid(tabIndex + 1, remote.size() - tabIndex - 8); result.insert(remote.left(tabIndex), url); } return result; @@ -2328,7 +2328,7 @@ void GitClient::endStashScope(const FilePath &workingDirectory) bool GitClient::isValidRevision(const QString &revision) const { - if (revision.length() < 1) + if (revision.size() < 1) return false; for (const auto i : revision) if (i != '0') |
