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

Unified Diff: lib/src/global_packages.dart

Issue 2184303002: Make pub strong-mode clean. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 5 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 | « lib/src/executable.dart ('k') | lib/src/io.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/src/global_packages.dart
diff --git a/lib/src/global_packages.dart b/lib/src/global_packages.dart
index 1c05501c99545befe4a8cec0fc64c08cc74ef316..2265e53a0de0b182be40bdb1c687c2f97580e21d 100644
--- a/lib/src/global_packages.dart
+++ b/lib/src/global_packages.dart
@@ -211,9 +211,7 @@ class GlobalPackages {
if (id.isRoot) return;
var source = cache.source(id.source);
- if (source is! CachedSource) return;
-
- await source.downloadToSystemCache(id);
+ if (source is CachedSource) await source.downloadToSystemCache(id);
}
/// Finishes activating package [package] by saving [lockFile] in the cache.
@@ -432,7 +430,7 @@ class GlobalPackages {
/// were successfully re-activated; the second indicates which failed.
Future<Pair<List<String>, List<String>>> repairActivatedPackages()
async {
- var executables = {};
+ var executables = <String, List<String>>{};
if (dirExists(_binStubDir)) {
for (var entry in listDir(_binStubDir)) {
try {
@@ -459,8 +457,8 @@ class GlobalPackages {
}
}
- var successes = [];
- var failures = [];
+ var successes = <String>[];
+ var failures = <String>[];
if (dirExists(_directory)) {
for (var entry in listDir(_directory)) {
var id;
@@ -551,8 +549,8 @@ class GlobalPackages {
ensureDir(_binStubDir);
- var installed = [];
- var collided = {};
+ var installed = <String>[];
+ var collided = <String, String>{};
var allExecutables = ordered(package.pubspec.executables.keys);
for (var executable in allExecutables) {
if (executables != null && !executables.contains(executable)) continue;
« no previous file with comments | « lib/src/executable.dart ('k') | lib/src/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698