Honestly I'm not sure much is being gained by removing a function call duplication at the cost of adding an additional check inside the for loop.