replace QHashIterator with QMultiHash::cbegin/cend#4377
Merged
uklotzde merged 1 commit intomixxxdj:mainfrom Oct 12, 2021
Merged
replace QHashIterator with QMultiHash::cbegin/cend#4377uklotzde merged 1 commit intomixxxdj:mainfrom
uklotzde merged 1 commit intomixxxdj:mainfrom
Conversation
uklotzde
suggested changes
Oct 12, 2021
| QHashIterator<SoundDeviceId, AudioOutput> it(outputs); | ||
| while (it.hasNext()) { | ||
| it.next(); | ||
| auto hash = config.getOutputs(); |
Contributor
There was a problem hiding this comment.
hashis not an appropriate variable name, how aboutoutputDeviceMap?const auto
| QHashIterator<SoundDeviceId, AudioInput> it(inputs); | ||
| while (it.hasNext()) { | ||
| it.next(); | ||
| auto hash = config.getInputs(); |
Contributor
There was a problem hiding this comment.
hashis not an appropriate variable name, how aboutinputDeviceMap?const auto
cc3b6d7 to
a04b838
Compare
uklotzde
reviewed
Oct 12, 2021
| QHashIterator<SoundDeviceId, AudioInput> it(inputs); | ||
| while (it.hasNext()) { | ||
| it.next(); | ||
| const auto inputDeviceHash = config.getInputs(); |
Contributor
There was a problem hiding this comment.
Conceptually this is still a key/value "map". It doesn't matter if it is a tree or a hash map. This is an implementation detail.
The term "hash" usually means hash code or value and not hash map when used standalone.
If we want to reference the underlying data structure in the naming then inputDeviceMap.
a04b838 to
03b18ee
Compare
QMultiHash is not a subclass of QHash in Qt6: https://doc.qt.io/qt-6/qtcore-changes-qt6.html#removal-of-qhash-insertmulti so the QHashIterator(const QHash<Key, T> &hash) constructor cannot be used with QMultiHash.
03b18ee to
b428f48
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
QMultiHash is not a subclass of QHash in Qt6:
https://doc.qt.io/qt-6/qtcore-changes-qt6.html#removal-of-qhash-insertmulti
so the
QHashIterator(const QHash<Key, T> &hash)
constructor cannot be used with QMultiHash.