The Wayback Machine - https://web.archive.org/web/20201202133302/https://github.com/qTox/qTox/issues/6038
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

QJsonArray's iterator doesn't return references, so acknowledge this in the code #6038

Open
iphydf opened this issue Mar 23, 2020 · 0 comments
Open

Comments

@iphydf
Copy link
Contributor

@iphydf iphydf commented Mar 23, 2020

src/net/bootstrapnodeupdater.cpp:186 says:

    for (const auto& node : nodes) {

which implies that we're taking a ref-to-const-QJsonValue, while actually we're making a temporary copy of a QJsonValueRef and then binding a const-ref to that. Instead, write:

    for (const QJsonValueRef node : nodes) {

to make it explicit that the copy is happening (it is, regardless of the & above), but also that it's of a lightweight "Ref" object.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.