cycle method
Lazy infinite iterable repeating this list. Audited: 2026-06-12 11:26 EDT
Implementation
Iterable<T> cycle() sync* {
if (isEmpty) return;
int i = 0;
while (true) {
yield this[i % length];
i++;
}
}
Lazy infinite iterable repeating this list. Audited: 2026-06-12 11:26 EDT
Iterable<T> cycle() sync* {
if (isEmpty) return;
int i = 0;
while (true) {
yield this[i % length];
i++;
}
}