Cache `literal.length` in a variable to avoid re-accessing it on each iteration.