Skip to content

replace - 1 with std::prev for QMap iterators#4371

Merged
uklotzde merged 1 commit intomixxxdj:mainfrom
Be-ing:qhashiterator_minus
Oct 10, 2021
Merged

replace - 1 with std::prev for QMap iterators#4371
uklotzde merged 1 commit intomixxxdj:mainfrom
Be-ing:qhashiterator_minus

Conversation

@Be-ing
Copy link
Copy Markdown
Contributor

@Be-ing Be-ing commented Oct 10, 2021

QMap::iterator operator- was removed in Qt6. It has been added
back in Qt 6.2 but with a deprecation warning saying to use
std::prev instead:
https://codereview.qt-project.org/c/qt/qtbase/+/362150

@Be-ing Be-ing force-pushed the qhashiterator_minus branch 2 times, most recently from 9d34c16 to fd22e9e Compare October 10, 2021 03:40
@Be-ing Be-ing changed the title replace - 1 with -- for QMap iterators replace - 1 with std::prev for QMap iterators Oct 10, 2021
QMap::iterator operator- was removed in Qt6. It has been added
back in Qt 6.2 but with a deprecation warning saying to use
std::prev instead:
https://codereview.qt-project.org/c/qt/qtbase/+/362150
@Be-ing Be-ing force-pushed the qhashiterator_minus branch from fd22e9e to 82b8846 Compare October 10, 2021 04:24
Copy link
Copy Markdown
Contributor

@uklotzde uklotzde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM

@uklotzde uklotzde merged commit 2e8f321 into mixxxdj:main Oct 10, 2021
@Be-ing Be-ing deleted the qhashiterator_minus branch October 10, 2021 13:22
@daschuer
Copy link
Copy Markdown
Member

How about using QMap::last()?
That would improve t readability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants