toSetE method
Converts the enumerable to a Dart Set
.
Iterates over the entire enumerable, storing the elements in a set. Once iteration completes, this set is returned.
Duplicate elements are determined by the default Dart Set
behavior (i.e.
by the hashCode property of T
. In the event of a duplicate element,
the previous element is preserved and the duplicate is discarded.
Implementation
Set<T> toSetE() {
final hSet = Set<T>();
final iterator = this.iterator;
while (iterator.moveNext()) {
hSet.add(iterator.current);
}
return hSet;
}