It's a good practice to cache length in a local variable.