because if the array is empty, the foreach loop would have no iterations to do anyway. Basic simplification.