diff options
| author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2019-03-19 20:28:03 -0400 |
|---|---|---|
| committer | FernandoS27 <fsahmkow27@gmail.com> | 2019-03-27 14:34:33 -0400 |
| commit | 15307bc4d1e03c0cc8b1f4e2e0ebb0998a0d0e40 (patch) | |
| tree | 1e057985ce48ce235226bc2e507ac55b7860f574 | |
| parent | 19cec0236a90aba3937ef130552d93f9121bc5a8 (diff) | |
Fixes to multilevelqueue's iterator.
| -rw-r--r-- | src/common/multi_level_queue.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common/multi_level_queue.h b/src/common/multi_level_queue.h index d56ab6531e..68b35ffaae 100644 --- a/src/common/multi_level_queue.h +++ b/src/common/multi_level_queue.h @@ -35,7 +35,11 @@ public: using difference_type = typename std::pointer_traits<pointer>::difference_type; friend bool operator==(const iterator_impl& lhs, const iterator_impl& rhs) { - return (lhs.IsEnd() && rhs.IsEnd()) || lhs.it == rhs.it; + if (lhs.IsEnd() && rhs.IsEnd()) + return true; + if (lhs.current_priority == rhs.current_priority) + return lhs.it == rhs.it; + return false; } friend bool operator!=(const iterator_impl& lhs, const iterator_impl& rhs) { |
