[Issue 17094] std.container.binaryheap doesn't manage store length consistently when inserting

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 29 21:54:44 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=17094

--- Comment #1 from Jon Degenhardt <jrdemail2000-dlang at yahoo.com> ---
Bump - Since it has been a year and no comments. Not suggesting raising the bug
priority, mostly want to be sure it had been seen. Eventually I'll likely take
a shot at this myself, but haven't had time yet.

Essentially, the 'length' property of the data store behind a binary heap is
left with an incorrect value in some circumstances. It's problematic if you run
into it. It applies to a common use of a binary heap: identifying a top-k set
of elements, followed by accessing the top-k elements in the top-k order.

Looking at the code further - I suspect it's not all that hard to fix, but that
it'll take some familiarity with the different types of possible data stores
(random access ranges) to get it correct.

--


More information about the Digitalmars-d-bugs mailing list