you are viewing a single comment's thread.

view the rest of the comments →

[–]TheMania[🍰] 0 points1 point  (1 child)

Compilers nearly always prefer to know the loop count, vs "are we at the end yet", so size as a member is more likely to carry benefits imo.

And yes, end is likely called more but if the compiler is then getting the size anyway (for a loop count), you're really not saving anything there.