Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(505)

Unified Diff: sdk/lib/_internal/lib/collection_patch.dart

Issue 289353002: Add SetBase/SetMixin. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updated to not use cloneEmpty Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/lib/collection_patch.dart
diff --git a/sdk/lib/_internal/lib/collection_patch.dart b/sdk/lib/_internal/lib/collection_patch.dart
index 463fab9c4cb24ca2a7f4e62af549ed2dc1c6134d..0c19fdbd35b35f6c5766e0439cb8b4e68ff31cf6 100644
--- a/sdk/lib/_internal/lib/collection_patch.dart
+++ b/sdk/lib/_internal/lib/collection_patch.dart
@@ -1126,24 +1126,6 @@ class _HashSet<E> extends _HashSetBase<E> implements HashSet<E> {
return true;
}
- void removeAll(Iterable<Object> objectsToRemove) {
- for (var each in objectsToRemove) {
- remove(each);
- }
- }
-
- void retainAll(Iterable<Object> elements) {
- super._retainAll(elements, (o) => o is E);
- }
-
- void removeWhere(bool test(E element)) {
- removeAll(_computeElements().where(test));
- }
-
- void retainWhere(bool test(E element)) {
- removeAll(_computeElements().where((E element) => !test(element)));
- }
-
void clear() {
if (_length > 0) {
_strings = _nums = _rest = _elements = null;
@@ -1347,25 +1329,6 @@ class _CustomHashSet<E> extends _HashSet<E> {
if (!_validKey(object)) return false;
return super._remove(object);
}
-
- bool containsAll(Iterable<Object> elements) {
- for (Object element in elements) {
- if (!_validKey(element) || !this.contains(element)) return false;
- }
- return true;
- }
-
- void removeAll(Iterable<Object> elements) {
- for (Object element in elements) {
- if (_validKey(element)) {
- super._remove(element);
- }
- }
- }
-
- void retainAll(Iterable<Object> elements) {
- super._retainAll(elements, _validKey);
- }
}
// TODO(kasperl): Share this code with HashMapKeyIterator<E>?
@@ -1568,12 +1531,6 @@ class _LinkedHashSet<E> extends _HashSetBase<E> implements LinkedHashSet<E> {
return true;
}
- void addAll(Iterable<E> objects) {
- for (E object in objects) {
- add(object);
- }
- }
-
bool remove(Object object) {
if (_isStringElement(object)) {
return _removeHashTableEntry(_strings, object);
@@ -1597,16 +1554,6 @@ class _LinkedHashSet<E> extends _HashSetBase<E> implements LinkedHashSet<E> {
return true;
}
- void removeAll(Iterable objectsToRemove) {
- for (var each in objectsToRemove) {
- remove(each);
- }
- }
-
- void retainAll(Iterable<Object> elements) {
- super._retainAll(elements, (o) => o is E);
- }
-
void removeWhere(bool test(E element)) {
_filterWhere(test, true);
}
@@ -1839,10 +1786,6 @@ class _LinkedCustomHashSet<E> extends _LinkedHashSet<E> {
}
}
}
-
- void retainAll(Iterable<Object> elements) {
- super._retainAll(elements, _validKey);
- }
}
class LinkedHashSetCell {

Powered by Google App Engine
This is Rietveld 408576698