It keeps from doing the array lookups and equality test on every iteration of the loop.