7f2b875b4a
Update some other methods to be more performant than the default inherited from `MapMixin`. Change argument validation to `map.[]=`, `map.putIfAbsent` and `set.add` checks that the key/element is allowed by the `compare` function. Previously the map methods just checked `key != null` (which was wrong), and compare did nothing special, both just relied on the `splay` call doing a `compare` call. That was not true for an empty map, which means that you could add a key/element which wasn't a valid comparable, as long as you did it as the *first* key/element. That is now caught. Bug: https://github.com/dart-lang/sdk/issues/45296 Change-Id: I8ba49a7892ed27daa4434f5fb7be3e777ef32bc9 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190883 Commit-Queue: Lasse R.H. Nielsen <lrn@google.com> Reviewed-by: Nate Bosch <nbosch@google.com>