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

Unified Diff: pkg/barback/lib/src/group_runner.dart

Issue 189623006: Avoid O(n^2) behavior in Barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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/barback/lib/src/group_runner.dart
diff --git a/pkg/barback/lib/src/group_runner.dart b/pkg/barback/lib/src/group_runner.dart
index 69aaaa97eb1a02dd2f6edcc75a4ab7e0d7ec9f5f..4ef344f20fc73ce3a4664186506674efab796ef7 100644
--- a/pkg/barback/lib/src/group_runner.dart
+++ b/pkg/barback/lib/src/group_runner.dart
@@ -27,7 +27,11 @@ class GroupRunner {
final _phases = new List<Phase>();
/// Whether [this] is dirty and still has more processing to do.
- bool get isDirty => _phases.any((phase) => phase.isDirty);
+ bool get isDirty {
+ // Just check the last phase, since it will check all the previous phases
+ // itself.
+ return _phases.last.isDirty;
+ }
/// A stream that emits an event whenever [this] is no longer dirty.
///

Powered by Google App Engine
This is Rietveld 408576698