3 ms·
What I quoted is talking about the 2nd version of the code, that tries to count without iterating three times and then encounters a laziness problem. The first
by cosarara 7y ago
What I quoted is talking about the 2nd version of the code, that tries to count without iterating three times and then encounters a laziness problem.
The first version iterates three times and the reason it takes long has nothing to do with lazyness, we agree on that.
- runeks 7y agoI see your point now. My mistake. In order to avoid iterating over the file three times, he writes the second version, which does require understanding laziness (in order to avoid high memory usage). I stand corrected.