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/barback/lib/src/asset_cascade.dart

Issue 22854022: Remove the transformless phase from AssetCascade. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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/phase.dart » ('j') | pkg/barback/lib/src/phase.dart » ('J')
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 341480d94ac92ff55ac8425d54331e7bc682a9b1..ba0a5b62e7b63c7112b83f4b7ad6a4dc932a397a 100644
--- a/pkg/barback/lib/src/asset_cascade.dart
+++ b/pkg/barback/lib/src/asset_cascade.dart
@@ -93,15 +93,11 @@ class AssetCascade {
// Flatten the phases to a list so we can traverse backwards to wire up
// each phase to its next.
var phases = transformerPhases.toList();
-
- // Each phase writes its outputs as inputs to the next phase after it.
- // Add a phase at the end for the final outputs of the last phase.
- phases.add([]);
+ if (phases.isEmpty) phases = [[]];
Phase nextPhase = null;
for (var transformers in phases.reversed) {
- nextPhase = new Phase(this, _phases.length, transformers.toList(),
- nextPhase);
+ nextPhase = new Phase(this, transformers.toList(), nextPhase);
nextPhase.onDirty.listen((_) {
_newChanges = true;
_waitForProcess();
@@ -128,7 +124,7 @@ class AssetCascade {
// * If [id] has never been generated and all active transformers provide
// metadata about the file names of assets it can emit, we can prove that
// none of them can emit [id] and fail early.
- return _phases.last.getInput(id).then((node) {
+ return _phases.last.getOutput(id).then((node) {
// If the requested asset is available, we can just return it.
if (node != null && node.state.isAvailable) return node;
« no previous file with comments | « no previous file | pkg/barback/lib/src/phase.dart » ('j') | pkg/barback/lib/src/phase.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698