Each call to .values() allocates a new array. Let's cache them once and for all to avoid unncessary allocations.