Chromium Code Reviews| Index: editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/operation/OperationQueue.java |
| diff --git a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/operation/OperationQueue.java b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/operation/OperationQueue.java |
| index 51547d7ddf5ec30afd2dffd0bab07016a79d3f95..3b3bf73625d49cd48c9d407d51d0b3eb3819c7b3 100644 |
| --- a/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/operation/OperationQueue.java |
| +++ b/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/index/operation/OperationQueue.java |
| @@ -15,6 +15,7 @@ package com.google.dart.engine.internal.index.operation; |
| import com.google.common.collect.Lists; |
| import com.google.dart.engine.source.Source; |
| +import com.google.dart.engine.utilities.translation.DartBlockBody; |
| import java.util.Iterator; |
| import java.util.LinkedList; |
| @@ -156,6 +157,7 @@ public class OperationQueue { |
| } |
| } |
| + @DartBlockBody({}) |
| private void notifyOperationAvailable() { |
| nonQueryOperations.notifyAll(); |
| } |
| @@ -163,6 +165,7 @@ public class OperationQueue { |
| /** |
| * Removes operations that should be removed when given {@link Source} is removed. |
| */ |
| + @DartBlockBody({"operations.removeWhere((_) => _.removeWhenSourceRemoved(source));"}) |
|
Brian Wilkerson
2014/03/07 16:12:31
Is this re-write for performance, or is there some
scheglov
2014/03/07 22:47:44
It is much better to use idiomatic Dart implementa
|
| private void removeForSource(Source source, LinkedList<IndexOperation> operations) { |
| for (Iterator<IndexOperation> iter = operations.listIterator(); iter.hasNext();) { |
| IndexOperation indexOperation = iter.next(); |
| @@ -172,6 +175,7 @@ public class OperationQueue { |
| } |
| } |
| + @DartBlockBody({}) |
| private void waitForOperationAvailable(long timeout) throws InterruptedException { |
| nonQueryOperations.wait(timeout); |
| } |