containsValue method

  1. @override
bool containsValue(
  1. dynamic value
)
override

Checks to see if the map contains a value. The result of this is dictated by the comparator function passed when creating the PersistentMap and uses it to check every entry value until a match is found. The function should therefore be capable of deep comparisons for structured types. Given that this function will check every value until a match is found it can potentially have significant performance impact.

Implementation

@override
bool containsValue(dynamic value) {
  assert(value != null);
  for (var v in values) {
    if (_valueComparator(v, value)) {
      return true;
    }
  }
  return false;
}