From f35e09fe0dee84e3373ea1e2daac8d120621fe61 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Tue, 19 Mar 2019 20:28:03 -0400 Subject: Fixes to multilevelqueue's iterator. --- src/common/multi_level_queue.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/multi_level_queue.h b/src/common/multi_level_queue.h index d56ab6531..68b35ffaa 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::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) { -- cgit v1.2.3