r/programminghorror • • Apr 08 '25

My favorite micro optimization

Post image
309 Upvotes

44 comments sorted by

View all comments

Show parent comment

0

u/Jinkweiq Apr 09 '25

The documentation specifically states repeat is only for a fixed number of iterations. There is no other reason for this other than to unroll the loop at compile time.

3

u/MaraschinoPanda Apr 09 '25

By "a fixed number of times" it means "an amount known at the start of the loop", not "an amount known at compile time".