| OLD | NEW |
| 1 // Copyright (c) 2015, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Fletch 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
| 4 | 4 |
| 5 import 'dart:fletch._system' as fletch; | 5 import 'dart:fletch._system' as fletch; |
| 6 | 6 import 'dart:fletch._system' show patch; |
| 7 const patch = "patch"; | |
| 8 | 7 |
| 9 @patch class HashMap<K, V> { | 8 @patch class HashMap<K, V> { |
| 10 @patch factory HashMap({ bool equals(K key1, K key2), | 9 @patch factory HashMap({ bool equals(K key1, K key2), |
| 11 int hashCode(K key), | 10 int hashCode(K key), |
| 12 bool isValidKey(potentialKey) }) { | 11 bool isValidKey(potentialKey) }) { |
| 13 if (isValidKey == null) { | 12 if (isValidKey == null) { |
| 14 if (hashCode == null) { | 13 if (hashCode == null) { |
| 15 if (equals == null) { | 14 if (equals == null) { |
| 16 return new _HashMap<K, V>(); | 15 return new _HashMap<K, V>(); |
| 17 } | 16 } |
| (...skipping 1394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1412 E lookup(Object o) => _validKey(o) ? super.lookup(o) : null; | 1411 E lookup(Object o) => _validKey(o) ? super.lookup(o) : null; |
| 1413 bool remove(Object o) => _validKey(o) ? super.remove(o) : false; | 1412 bool remove(Object o) => _validKey(o) ? super.remove(o) : false; |
| 1414 | 1413 |
| 1415 _CompactLinkedCustomHashSet(this._equality, this._hasher, validKey) | 1414 _CompactLinkedCustomHashSet(this._equality, this._hasher, validKey) |
| 1416 : _validKey = (validKey != null) ? validKey : _defaultTypeTest; | 1415 : _validKey = (validKey != null) ? validKey : _defaultTypeTest; |
| 1417 | 1416 |
| 1418 Set<E> toSet() => | 1417 Set<E> toSet() => |
| 1419 new _CompactLinkedCustomHashSet<E>(_equality, _hasher, _validKey) | 1418 new _CompactLinkedCustomHashSet<E>(_equality, _hasher, _validKey) |
| 1420 ..addAll(this); | 1419 ..addAll(this); |
| 1421 } | 1420 } |
| OLD | NEW |