get method

V? get(
  1. Object? key
)

Returns the value associated with key, or null if not present.

  • A null key is not supported and always returns null.

Implementation

V? get(Object? key) {
  if (key == null) return null;

  final objHash = key.hashCode;
  final groupIdx = _groupIndex(objHash, _groups.length);

  var pos = _groups[groupIdx];
  while (pos > 0) {
    if (_chainHash[pos] == objHash && key == _chainKey[pos]) {
      return _chainVal[pos];
    }
    pos = _chainNext[pos];
  }
  return null;
}