Moved tiny calculation outside of loop