whereType<C> method

  1. @override
Iterable<C> whereType<C>()
inherited

Creates a new lazy Iterable with all elements that have type C.

When available, the cached result is used (as in query) in constant time. Otherwise, this works exactly the same as Iterable.whereType, in linear time.

Implementation

@override
Iterable<C> whereType<C>() {
  final result = _cache[C];
  if (result != null) {
    return result.data as Iterable<C>;
  }
  return super.whereType<C>();
}