| OLD | NEW |
| 1 part of dart.collection; | 1 part of dart.collection; |
| 2 | 2 |
| 3 abstract class _HashSetBase<E> extends SetBase<E> { | 3 abstract class _HashSetBase<E> extends SetBase<E> { |
| 4 Set<E> difference(Set<Object> other) { | 4 Set<E> difference(Set<Object> other) { |
| 5 Set<E> result = _newSet(); | 5 Set<E> result = _newSet(); |
| 6 for (var element in this) { | 6 for (var element in this) { |
| 7 if (!other.contains(element)) result.add(DDC$RT.cast(element, dynamic, E, | 7 if (!other.contains(element)) result.add(DDC$RT.cast(element, dynamic, E, |
| 8 "CastGeneral", | 8 "CastGeneral", |
| 9 """line 17, column 48 of dart:collection/hash_set.dart: """, | 9 """line 17, column 48 of dart:collection/hash_set.dart: """, |
| 10 element is E, false)); | 10 element is E, false)); |
| 11 } | 11 } |
| 12 return result; | 12 return result; |
| 13 } | 13 } |
| 14 Set<E> intersection(Set<Object> other) { | 14 Set<E> intersection(Set<Object> other) { |
| 15 Set<E> result = _newSet(); | 15 Set<E> result = _newSet(); |
| 16 for (var element in this) { | 16 for (var element in this) { |
| 17 if (other.contains(element)) result.add(DDC$RT.cast(element, dynamic, E, | 17 if (other.contains(element)) result.add(DDC$RT.cast(element, dynamic, E, |
| 18 "CastGeneral", | 18 "CastGeneral", |
| 19 """line 25, column 47 of dart:collection/hash_set.dart: """, | 19 """line 25, column 47 of dart:collection/hash_set.dart: """, |
| 20 element is E, false)); | 20 element is E, false)); |
| 21 } | 21 } |
| 22 return result; | 22 return result; |
| 23 } | 23 } |
| 24 Set<E> _newSet(); | 24 Set<E> _newSet(); |
| 25 Set<E> toSet() => _newSet()..addAll(this); | 25 Set<E> toSet() => _newSet()..addAll(this); |
| 26 } | 26 } |
| 27 abstract class HashSet<E> implements Set<E> { | 27 abstract class HashSet<E> implements Set<E> { |
| 28 factory HashSet({bool equals(E e1, E e2), int hashCode(E e), | 28 external factory HashSet({bool equals(E e1, E e2), int hashCode(E e), |
| 29 bool isValidKey(potentialKey)}) { | 29 bool isValidKey(potentialKey)}); |
| 30 if (isValidKey == null) { | 30 external factory HashSet.identity(); |
| 31 if (hashCode == null) { | |
| 32 if (equals == null) { | |
| 33 return new _HashSet<E>(); | |
| 34 } | |
| 35 hashCode = _defaultHashCode; | |
| 36 } else { | |
| 37 if (identical(identityHashCode, hashCode) && | |
| 38 identical(identical, equals)) { | |
| 39 return new _IdentityHashSet<E>(); | |
| 40 } | |
| 41 if (equals == null) { | |
| 42 equals = _defaultEquals; | |
| 43 } | |
| 44 } | |
| 45 } else { | |
| 46 if (hashCode == null) { | |
| 47 hashCode = _defaultHashCode; | |
| 48 } | |
| 49 if (equals == null) { | |
| 50 equals = _defaultEquals; | |
| 51 } | |
| 52 } | |
| 53 return new _CustomHashSet<E>(equals, hashCode, isValidKey); | |
| 54 } | |
| 55 factory HashSet.identity() = _IdentityHashSet<E>; | |
| 56 factory HashSet.from(Iterable elements) { | 31 factory HashSet.from(Iterable elements) { |
| 57 HashSet<E> result = new HashSet<E>(); | 32 HashSet<E> result = new HashSet<E>(); |
| 58 for (E e in elements) result.add(e); | 33 for (E e in elements) result.add(e); |
| 59 return result; | 34 return result; |
| 60 } | 35 } |
| 61 Iterator<E> get iterator; | 36 Iterator<E> get iterator; |
| 62 } | 37 } |
| OLD | NEW |