Created
June 22, 2022 13:56
-
-
Save yoloroy/ab9d4e01285e0d25deadd9c582c1c81d to your computer and use it in GitHub Desktop.
Infinite iterator extension for Iterable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun <T> Iterable<T>.infiniteIterator() = iterator { | |
| while (true) yieldAll(this@infiniteIterator) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment