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

Unified Diff: pkg/analyzer/lib/src/generated/utilities_general.dart

Issue 1420783004: Last performed task diagnostics. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Label. Created 5 years, 2 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
« no previous file with comments | « pkg/analysis_server/lib/src/status/get_handler.dart ('k') | pkg/analyzer/lib/task/model.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/utilities_general.dart
diff --git a/pkg/analyzer/lib/src/generated/utilities_general.dart b/pkg/analyzer/lib/src/generated/utilities_general.dart
index d120a81abdd6e0a9b12554d53bbb5c556f21071f..d000b54e7bf4db8f73db664cf8076a957f107f67 100644
--- a/pkg/analyzer/lib/src/generated/utilities_general.dart
+++ b/pkg/analyzer/lib/src/generated/utilities_general.dart
@@ -4,6 +4,7 @@
library engine.utilities.general;
+import 'dart:collection';
import 'dart:developer' show UserTag;
/**
@@ -32,6 +33,26 @@ class JenkinsSmiHash {
}
/**
+ * A simple limited queue.
+ */
+class LimitedQueue<E> extends ListQueue<E> {
+ final int limit;
+
+ /**
+ * Create a queue with [limit] items.
+ */
+ LimitedQueue(this.limit);
+
+ @override
+ void add(E o) {
+ super.add(o);
+ while (length > limit) {
+ remove(first);
+ }
+ }
+}
+
+/**
* Helper class for gathering performance statistics. This class is modeled on
* the UserTag class in dart:developer so that it can interoperate easily with
* it.
« no previous file with comments | « pkg/analysis_server/lib/src/status/get_handler.dart ('k') | pkg/analyzer/lib/task/model.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698