4 ms·
I wouldn't even really call that loop example an "optimization", it is just the obviously more efficient implementation.
by cirrus3 2y ago
I wouldn't even really call that loop example an "optimization", it is just the obviously more efficient implementation.
- riskable 2y agoYet I see it constantly. That pattern of `for foo in whatever: for bar in foo` is everywhere. People don't even think about it... They just write the looping part then start thinking about the logic below. It's such a common thing I'm surprised compilers and interpreters don't just optimize it away :shrug: