← Back to index
|
Original Bugzilla link
Bug 15420 – topN(Range, Range) does not respect its less predicate
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-12-08T06:53:00Z
Last change time
2015-12-10T22:26:21Z
Assigned to
nobody
Creator
lt.infiltrator
Comments
Comment #0
by lt.infiltrator — 2015-12-08T06:53:05Z
============= import std.algorithm; import std.stdio; void main() { int[] a = [ 5, 7, 2, 6, 7 ]; int[] b = [ 2, 1, 5, 6, 7, 3, 0 ]; topN!"a > b"(a, b); sort!"a > b"(a); assert(a == [ 7, 7, 7, 6, 6 ]); } ============= The above code fails on the assertion because topN has ignored the predicate given to it.
Comment #1
by lt.infiltrator — 2015-12-08T06:57:56Z
https://github.com/D-Programming-Language/phobos/pull/3863
Comment #2
by github-bugzilla — 2015-12-10T22:26:20Z
Commit pushed to master at
https://github.com/D-Programming-Language/phobos
https://github.com/D-Programming-Language/phobos/commit/66e01c324cd93b7775c1dc912e1618f8b957c894
Merge pull request #3863 from Infiltrator/patch-4 Fix Issue 15420 - topN(Range, Range) does not respect its less predicate