logic-circuits-simulator/lib/utils/iterable_extension.dart
2022-06-01 19:11:48 +03:00

6 lines
No EOL
171 B
Dart

extension IndexedMap<T> on Iterable<T> {
Iterable<O> indexedMap<O>(O Function(int, T) toElement) {
int index = 0;
return map((e) => toElement(index++, e));
}
}