Alex Henrie alexhenrie24@gmail.com writes:
The string length was computed during the loop earlier in the function. There is no need to call the O(n) strlen function to compute it again.
Saving a couple of cycles in a function that is executed at most once is irrelevant, and not worth the code churn. Please avoid such "optimizations".