customizeAs<R> method
Iterable<R>
customizeAs<
R>( - R combine(
- E element
), [
- bool checker(
- R value
)?
])
Implementation
Iterable<R> customizeAs<R>(
R Function(E element) combine, [
bool Function(R value)? checker,
]) {
List<R> initial = [];
Iterator<E> iterator = this.iterator;
if (!iterator.moveNext()) return initial;
R value = combine(iterator.current);
if (checker == null || checker(value)) initial.add(value);
while (iterator.moveNext()) {
R value = combine(iterator.current);
if (checker == null || checker(value)) initial.add(value);
}
return initial;
}