-
Notifications
You must be signed in to change notification settings - Fork 898
refactor: Use correct string overload #8992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| queryArgs.addQueryItem(QLatin1String("service"), QLatin1String("files")); | ||
| queryArgs.addQueryItem(QLatin1String("t"), data.value("token").toString()); | ||
| url = QUrl(Utility::concatUrlPath(_account->url(), QLatin1String("public.php"), queryArgs).toString()); | ||
| queryArgs.addQueryItem(u"service"_s, u"files"_s); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering why these strings don't use the _L1 literal here... does addQueryItem just not accept QLatin1StringViews?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's worth to use a QLatinStringView when the method takes a QAnyStringView (atm it's mostly lot of json, xml relared functions and string comparison)
In the other case, the QLatin1String will be converted first to a QString and in these cases a QStringLiteral is faster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I see! thanks for the explanation :)
Use QLatin1String overload when possible (mostly QJsonObject and string comparaison). See https://www.volkerkrause.eu/2023/09/09/qt-string-bloat.html Save around 11Kib in the final binary. Signed-off-by: Carl Schwan <[email protected]>
1f6c22c to
c740c34
Compare
|
Artifact containing the AppImage: nextcloud-appimage-pr-8992.zip Digest: To test this change/fix you can download the above artifact file, unzip it, and run it. Please make sure to quit your existing Nextcloud app and backup your data. |
|
|
/backport to stable-3.17 |
|
/backport to stable-4.0 |




Use QLatin1String overload when possible (mostly QJsonObject and string comparaison).
See https://www.volkerkrause.eu/2023/09/09/qt-string-bloat.html
Save around 11Kib in the final binary.