There's a guarantee that it won't be nil, and if it's empty, doing the loop won't hurt. So maybe drop this condition?