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

Unified Diff: sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart

Issue 566093003: Create binstubs for executables when activating a package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise! Created 6 years, 3 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: sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
diff --git a/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart b/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
index 613d94e890a15fd84540ccba6ecfc1e849679cc2..7b0fca29113b139647522de3f5ecaab5dc059d4a 100644
--- a/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
+++ b/sdk/lib/_internal/pub/lib/src/barback/asset_environment.dart
@@ -583,15 +583,12 @@ class AssetEnvironment {
/// this is optimized for our needs in here instead of using the more general
/// but slower [listDir].
Iterable<AssetId> _listDirectorySources(Package package, String dir) {
- var subdirectory = path.join(package.dir, dir);
- if (!dirExists(subdirectory)) return [];
-
// This is used in some performance-sensitive paths and can list many, many
// files. As such, it leans more havily towards optimization as opposed to
// readability than most code in pub. In particular, it avoids using the
// path package, since re-parsing a path is very expensive relative to
// string operations.
- return package.listFiles(beneath: subdirectory).map((file) {
+ return package.listFiles(beneath: dir).map((file) {
// From profiling, path.relative here is just as fast as a raw substring
// and is correct in the case where package.dir has a trailing slash.
var relative = path.relative(file, from: package.dir);

Powered by Google App Engine
This is Rietveld 408576698