Skip to content
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

opt: replace some inefficient uses of QUrlQuery #2003

Merged

Conversation

shenlebantongying
Copy link
Collaborator

@shenlebantongying shenlebantongying commented Nov 28, 2024

The original purpose of Utils::Url::addQueryItem was for accommodating Qt4x5 which were wrappers of Qt4 -> Qt5 API changes.

This one is inefficient because the construction of QUrlQuery needs to parse the query part of the URL. Each call of this function reparse the string.

The worst case scenario of the one in articleview.cc is reparsing the query string 8 times, and each time it gets slightly more expensive.

I am not motivated to replace all, so only the ones in mission criticl sections are replaced.

Copy link

sonarcloud bot commented Nov 28, 2024

@shenlebantongying shenlebantongying merged commit a16e560 into xiaoyifang:staged Nov 28, 2024
8 checks passed
@shenlebantongying shenlebantongying deleted the opt/better-qurlquery branch November 28, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant