2 ms·
> I've heard the primary reason for it is to avoid the possibility of wraparound on Making it UB doesn’t fix that in any way that I can think of.
by vlovich123 2y ago
> I've heard the primary reason for it is to avoid the possibility of wraparound on
Making it UB doesn’t fix that in any way that I can think of.
- anttihaapala 2y agoWhat it means is that since i as the variable is monotonically increasing, an array indexing operation that is in the loop body can be replaced with an incrementing pointer instead, which eliminates quite a lot of code. An example here: https://pvs-studio.com/en/blog/posts/cpp/0374/ https://pvs-studio.com/en/blog/posts/cpp/0374/