getSetEntryInstance<T> function

T? getSetEntryInstance<T>(
  1. Set<T>? set,
  2. T? value
)

Returns the instance that matches value in set.

Implementation

T? getSetEntryInstance<T>(Set<T>? set, T? value) {
  if (set == null || value == null) return null;
  if (!set.contains(value)) return null;

  for (var elem in set) {
    if (elem == value) {
      return elem;
    }
  }
  return null;
}