same method

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

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

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

Implementation

@override
bool same(IList<T>? other) =>
    (other != null) &&
    (other is IListConst) &&
    identical(_list, (other as IListConst)._list) &&
    (config == other.config);