| 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 patch class HashMap<K, V> { | 5 patch class HashMap<K, V> { |
| 6 /* patch */ factory HashMap({ bool equals(K key1, K key2), | 6 /* patch */ factory HashMap({ bool equals(K key1, K key2), |
| 7 int hashCode(K key), | 7 int hashCode(K key), |
| 8 bool isValidKey(potentialKey) }) { | 8 bool isValidKey(potentialKey) }) { |
| 9 if (isValidKey == null) { | 9 if (isValidKey == null) { |
| 10 if (hashCode == null) { | 10 if (hashCode == null) { |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 _HashSetEntry result = next; | 769 _HashSetEntry result = next; |
| 770 next = null; | 770 next = null; |
| 771 return result; | 771 return result; |
| 772 } | 772 } |
| 773 } | 773 } |
| 774 | 774 |
| 775 class _HashSetIterator<E> implements Iterator<E> { | 775 class _HashSetIterator<E> implements Iterator<E> { |
| 776 final _HashSet _set; | 776 final _HashSet _set; |
| 777 final int _modificationCount; | 777 final int _modificationCount; |
| 778 int _index = 0; | 778 int _index = 0; |
| 779 _HashSetEntry _next = null; | 779 _HashSetEntry _next; |
| 780 E _current = null; | 780 E _current; |
| 781 | 781 |
| 782 _HashSetIterator(_HashSet hashSet) | 782 _HashSetIterator(_HashSet hashSet) |
| 783 : _set = hashSet, _modificationCount = hashSet._modificationCount; | 783 : _set = hashSet, _modificationCount = hashSet._modificationCount; |
| 784 | 784 |
| 785 bool moveNext() { | 785 bool moveNext() { |
| 786 if (_modificationCount != _set._modificationCount) { | 786 if (_modificationCount != _set._modificationCount) { |
| 787 throw new ConcurrentModificationError(_set); | 787 throw new ConcurrentModificationError(_set); |
| 788 } | 788 } |
| 789 if (_next != null) { | 789 if (_next != null) { |
| 790 _current = _next.key; | 790 _current = _next.key; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 844 int get length => _map.length; | 844 int get length => _map.length; |
| 845 } | 845 } |
| 846 | 846 |
| 847 abstract class _LinkedHashMapIterator<T> implements Iterator<T> { | 847 abstract class _LinkedHashMapIterator<T> implements Iterator<T> { |
| 848 final LinkedHashMap _map; | 848 final LinkedHashMap _map; |
| 849 var _next; | 849 var _next; |
| 850 T _current; | 850 T _current; |
| 851 int _modificationCount; | 851 int _modificationCount; |
| 852 _LinkedHashMapIterator(LinkedHashMap map) | 852 _LinkedHashMapIterator(LinkedHashMap map) |
| 853 : _map = map, | 853 : _map = map, |
| 854 _current = null, | |
| 855 _next = map._nextEntry, | 854 _next = map._nextEntry, |
| 856 _modificationCount = map._modificationCount; | 855 _modificationCount = map._modificationCount; |
| 857 | 856 |
| 858 bool moveNext() { | 857 bool moveNext() { |
| 859 if (_modificationCount != _map._modificationCount) { | 858 if (_modificationCount != _map._modificationCount) { |
| 860 throw new ConcurrentModificationError(_map); | 859 throw new ConcurrentModificationError(_map); |
| 861 } | 860 } |
| 862 if (identical(_map, _next)) { | 861 if (identical(_map, _next)) { |
| 863 _current = null; | 862 _current = null; |
| 864 return false; | 863 return false; |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 return false; | 1240 return false; |
| 1242 } | 1241 } |
| 1243 _LinkedHashSetEntry entry = _next; | 1242 _LinkedHashSetEntry entry = _next; |
| 1244 _current = entry.key; | 1243 _current = entry.key; |
| 1245 _next = entry._nextEntry; | 1244 _next = entry._nextEntry; |
| 1246 return true; | 1245 return true; |
| 1247 } | 1246 } |
| 1248 | 1247 |
| 1249 E get current => _current; | 1248 E get current => _current; |
| 1250 } | 1249 } |
| OLD | NEW |