newOverridesSet<T> static method

Set<Object> newOverridesSet<T>(
  1. Set<AspectOverride<Object?, T>>? other
)

Implementation

static Set<Object> newOverridesSet<T>(
    Set<AspectOverride<Object?, T>>? other) {
  if (other == null) return {};
  bool? hashKeysOnly;
  return HashSet(
    isValidKey: (obj) => obj != null,
    hashCode: (Object obj) {
      // after the first time, we don't care for other objects
      hashKeysOnly ??= obj is _AspectOverrideByKey;
      if (hashKeysOnly! && obj is InheritableAspect<T>) {
        return obj.key.hashCode;
      }

      return obj.hashCode;
    },
    equals: (Object a, Object b) => a == b,
  )..addAll(other);
}