same method

  1. @override
bool same(
  1. ISet<T>? other
)
override

Will return true only if the sets internals are the same instances (comparing by identity). This will be fast even for very large sets, since it doesn't compare each item.

Note: This is not the same as identical(set1, set2) since it doesn't compare the sets themselves, but their internal state. Comparing the internal state is better, because it will return true more often.

Implementation

@override
bool same(ISet<T>? other) =>
    (other != null) && identical(_s, other._s) && (config == other.config);