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

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

Issue 189623006: Avoid O(n^2) behavior in Barback. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: code review 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
« no previous file with comments | « no previous file | pkg/barback/lib/src/group_runner.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/barback/lib/src/asset_cascade.dart
diff --git a/pkg/barback/lib/src/asset_cascade.dart b/pkg/barback/lib/src/asset_cascade.dart
index 633184afbbf584359a38a57ea15bc862b782e334..b87ca39ae874cb26c74e72928d13b87ffcd8ba28 100644
--- a/pkg/barback/lib/src/asset_cascade.dart
+++ b/pkg/barback/lib/src/asset_cascade.dart
@@ -64,7 +64,11 @@ class AssetCascade {
final _onLogPool = new StreamPool<LogEntry>.broadcast();
/// 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.
///
« no previous file with comments | « no previous file | pkg/barback/lib/src/group_runner.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698