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

Unified Diff: sdk/lib/_internal/compiler/implementation/util/setlet.dart

Issue 288103003: Change Set.toSet to always return a set with the same behavior. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update html5lib pubspec version to 0.12.0-dev 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/compiler/implementation/util/setlet.dart
diff --git a/sdk/lib/_internal/compiler/implementation/util/setlet.dart b/sdk/lib/_internal/compiler/implementation/util/setlet.dart
index 0d4571be856b8f1cebfc9dc0065e13ce92124f33..79e04e830066b5a821397bd3dd0b388fdaa24a5b 100644
--- a/sdk/lib/_internal/compiler/implementation/util/setlet.dart
+++ b/sdk/lib/_internal/compiler/implementation/util/setlet.dart
@@ -249,6 +249,20 @@ class Setlet<E> extends IterableBase<E> implements Set<E> {
Setlet<E> difference(Set<E> other) =>
new Setlet<E>.from(this.where((e) => !other.contains(e)));
+
+ Setlet<E> toSet() {
+ Setlet<E> result = new Setlet<E>();
+ if (_extra == null) {
+ result._contents = _contents;
+ } else if (_extra == MARKER) {
+ result._extra = MARKER;
+ result._contents = _contents.toSet();
+ } else {
+ result._extra = _extra;
+ result._contents = _contents.toList();
+ }
+ return result;
+ }
}
class _SetletMarker {

Powered by Google App Engine
This is Rietveld 408576698