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

Unified Diff: pkg/compiler/lib/src/util/link_implementation.dart

Issue 1302333006: Support metadata on patches. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Remove partial renaming Created 5 years, 3 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: pkg/compiler/lib/src/util/link_implementation.dart
diff --git a/pkg/compiler/lib/src/util/link_implementation.dart b/pkg/compiler/lib/src/util/link_implementation.dart
index 74d9f231fa8c3495f5460be462b992c4ce43c3e6..973ef50a9c983638b88d1f48a81e6dc78693962e 100644
--- a/pkg/compiler/lib/src/util/link_implementation.dart
+++ b/pkg/compiler/lib/src/util/link_implementation.dart
@@ -169,6 +169,7 @@ class LinkBuilderImplementation<T> implements LinkBuilder<T> {
Link<T> link = head;
lastLink = null;
head = null;
+ length = 0;
return link;
}
@@ -184,6 +185,7 @@ class LinkBuilderImplementation<T> implements LinkBuilder<T> {
}
lastLink = null;
head = null;
+ length = 0;
return list;
}
@@ -200,4 +202,17 @@ class LinkBuilderImplementation<T> implements LinkBuilder<T> {
}
bool get isEmpty => length == 0;
+
+ T get first {
+ if (head != null) {
+ return head.head;
+ }
+ throw new StateError("no elements");
+ }
+
+ void clear() {
+ head = null;
+ lastLink = null;
+ length = 0;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698