OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
| 5 import 'dart:typed_data'; |
| 6 import 'dart:_internal' as internal; |
| 7 |
5 @patch class HashMap<K, V> { | 8 @patch class HashMap<K, V> { |
6 @patch factory HashMap({ bool equals(K key1, K key2), | 9 @patch factory HashMap({ bool equals(K key1, K key2), |
7 int hashCode(K key), | 10 int hashCode(K key), |
8 bool isValidKey(potentialKey) }) { | 11 bool isValidKey(potentialKey) }) { |
9 if (isValidKey == null) { | 12 if (isValidKey == null) { |
10 if (hashCode == null) { | 13 if (hashCode == null) { |
11 if (equals == null) { | 14 if (equals == null) { |
12 return new _HashMap<K, V>(); | 15 return new _HashMap<K, V>(); |
13 } | 16 } |
14 hashCode = _defaultHashCode; | 17 hashCode = _defaultHashCode; |
15 } else { | 18 } else { |
16 if (identical(identityHashCode, hashCode) && | 19 if (identical(identityHashCode, hashCode) && |
17 identical(identical, equals)) { | 20 identical(identical, equals)) { |
18 return new _IdentityHashMap<K, V>(); | 21 return new _IdentityHashMap<K, V>(); |
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 if (equals == null) { | 972 if (equals == null) { |
970 equals = _defaultEquals; | 973 equals = _defaultEquals; |
971 } | 974 } |
972 } | 975 } |
973 return new _CompactLinkedCustomHashSet<E>(equals, hashCode, isValidKey); | 976 return new _CompactLinkedCustomHashSet<E>(equals, hashCode, isValidKey); |
974 } | 977 } |
975 | 978 |
976 @patch factory LinkedHashSet.identity() = | 979 @patch factory LinkedHashSet.identity() = |
977 _CompactLinkedIdentityHashSet<E>; | 980 _CompactLinkedIdentityHashSet<E>; |
978 } | 981 } |
OLD | NEW |