Opened 3 years ago

Closed 3 years ago

#927 closed defect (fixed)

PriorityQueue only stores unique elements

Reported by: Peter Owned by: Peter
Priority: critical Milestone: yat 0.16.1
Component: utility Version: 0.16
Keywords: Cc:


PriorityQueue? is implemented using an std::set<T> and is therefore not handling equivalent samples as expected. If two equivalent elements are inserted into the PriorityQueue? only one is stored just like when inserting equivalent elements into a std::set.

This bug has most likely been there since dawn of time.

Change History (2)

comment:1 Changed 3 years ago by Peter

Owner: changed from Jari Häkkinen to Peter
Status: newaccepted

comment:2 Changed 3 years ago by Peter

Resolution: fixed
Status: acceptedclosed

In 3829:

fixes #927. PriorityQueue? used an std::set internally, which meant it could only store unique elements. Fix this unexpected behaviour by using an std::multiset instead.

Note: See TracTickets for help on using tickets.