commit | 4c6d40c86c20f02ed6f73412f2be9141ae6a9553 | [log] [tgz] |
---|---|---|
author | Lasse R.H. Nielsen <lrn@google.com> | Mon May 22 14:38:36 2017 +0200 |
committer | Lasse R.H. Nielsen <lrn@google.com> | Mon May 22 14:38:37 2017 +0200 |
tree | 8e39374977c44fd20afbed686abd4ff35eabf7fa | |
parent | c572a1e908a41ee4c9fc98880de8c4df28ea949c [diff] |
Make Equality.hash accept null as an argument. This just makes it easier to use the equality directly on a nullable type. The `isValidKey` check still say no for `null`. R=floitsch@google.com Committed: https://github.com/dart-lang/collection/commit/c572a1e908a41ee4c9fc98880de8c4df28ea949c Review-Url: https://codereview.chromium.org//2898693002 .
diff --git a/lib/src/equality.dart b/lib/src/equality.dart index a970664..2c6c272 100644 --- a/lib/src/equality.dart +++ b/lib/src/equality.dart
@@ -164,7 +164,7 @@ } int hash(List<E> list) { - if (elements == null) return null.hashCode; + if (list == null) return null.hashCode; // Jenkins's one-at-a-time hash function. // This code is almost identical to the one in IterableEquality, except // that it uses indexing instead of iterating to get the elements.