Improve IteratorProvider::cycle() implement