Decrease number of front evaluations

FreeSlave via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Wed Aug 26 01:33:35 PDT 2015


On Wednesday, 26 August 2015 at 08:30:04 UTC, Yazan D wrote:
> On Wed, 26 Aug 2015 08:27:05 +0000, FreeSlave wrote:
>> 
>> Are there ways to fix this? Should I consider writing my own 
>> range type probably?
>
> Check 
> http://dlang.org/phobos/std_algorithm_iteration.html#.cache

I tried it. It can help with map (still calls 2 times though) but 
the number of filter's predicate calls stay the same.


More information about the Digitalmars-d-learn mailing list