logic-circuits-simulator/lib/utils/iterable_extension.dart

6 lines
171 B
Dart
Raw Normal View History

2022-06-01 19:11:48 +03:00
extension IndexedMap<T> on Iterable<T> {
Iterable<O> indexedMap<O>(O Function(int, T) toElement) {
int index = 0;
return map((e) => toElement(index++, e));
}
}