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

Unified Diff: pkg/analysis_server/lib/src/operation/operation_queue.dart

Issue 725143004: Format and sort analyzer and analysis_server packages. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 1 month 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/operation/operation.dart ('k') | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/operation/operation_queue.dart
diff --git a/pkg/analysis_server/lib/src/operation/operation_queue.dart b/pkg/analysis_server/lib/src/operation/operation_queue.dart
index c03318511b738390ac8c31c166aa368d6f5ea03b..b26c677f60e2d6d7479d42c899f2cdfc2fd0f491 100644
--- a/pkg/analysis_server/lib/src/operation/operation_queue.dart
+++ b/pkg/analysis_server/lib/src/operation/operation_queue.dart
@@ -7,8 +7,8 @@ library operation.queue;
import 'dart:collection';
import 'package:analysis_server/src/analysis_server.dart';
-import 'package:analysis_server/src/operation/operation_analysis.dart';
import 'package:analysis_server/src/operation/operation.dart';
+import 'package:analysis_server/src/operation/operation_analysis.dart';
/**
@@ -30,11 +30,18 @@ class ServerOperationQueue {
}
/**
+ * Returns `true` if there are no queued [ServerOperation]s.
+ */
+ bool get isEmpty {
+ return _queues.every((queue) => queue.isEmpty);
+ }
+
+ /**
* Adds the given operation to this queue. The exact position in the queue
* depends on the priority of the given operation relative to the priorities
* of the other operations in the queue.
*/
- void add(ServerOperation operation) {
+ void add(ServerOperation operation) {
int queueIndex = operation.priority.ordinal;
Queue<ServerOperation> queue = _queues[queueIndex];
queue.addLast(operation);
@@ -50,13 +57,6 @@ class ServerOperationQueue {
}
/**
- * Returns `true` if there are no queued [ServerOperation]s.
- */
- bool get isEmpty {
- return _queues.every((queue) => queue.isEmpty);
- }
-
- /**
* Returns the next operation to perform or `null` if empty.
*/
ServerOperation take() {
@@ -80,4 +80,3 @@ class ServerOperationQueue {
return null;
}
}
-
« no previous file with comments | « pkg/analysis_server/lib/src/operation/operation.dart ('k') | pkg/analysis_server/lib/src/protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698