[Issue 13936] groupBy must be redone

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


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

--- Comment #33 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to hsteoh from comment #32)
> (In reply to Andrei Alexandrescu from comment #31)
> > (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.
> 
> No it won't. You just assign groupNext.save to groupCurrent, then call
> groupNext.popFront.

Then I must be misunderstanding something.

--


More information about the Digitalmars-d-bugs mailing list