[Issue 13936] groupBy must be redone

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jan 12 13:25:19 PST 2015


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

--- Comment #31 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to hsteoh from comment #28)
> Another note: your current implementation looks like it could be easily
> extended to handle non-equivalence predicates. All you need to do is to
> evaluate the predicate on adjacent elements vs. with the head of the group
> (IOW, just advance groupStart each time in Group.popFront). I doubt it would
> cause too much performance hit.

That would popFront two ranges instead of one. I still very strongly suggest we
define groupBy and groupByAdjancent.

--


More information about the Digitalmars-d-bugs mailing list