Avoid allocation of empty iterators.