length property

int length
override

Returns the number of elements in the iterable.

This is an efficient operation that doesn't require iterating through the elements.

Implementation

int get length => _disjoint
    ? _sets.fold(0, (length, set) => length + set.length)
    : _iterable.length;