On Tue Aug 6 13:52:50 2024 +0000, Haoran Wang wrote:
My attempts to rewrite this loop always ended up the same original code... So instead I tried to make it to be more clear.
Hm, did my suggestion not end up working?
FWIW, I believe pretty strongly that readable and idiomatic code is worth the higher line count, or less "optimized" loops, at least in cases like this where optimization isn't important.