Index: utils/pub/hosted_source.dart |
diff --git a/utils/pub/hosted_source.dart b/utils/pub/hosted_source.dart |
index 4d6626f594d6f0f26878399b563ad89c48041d2f..7323ec5a4ff65f905f3c3ac21efbc6dcb9cef02d 100644 |
--- a/utils/pub/hosted_source.dart |
+++ b/utils/pub/hosted_source.dart |
@@ -118,17 +118,13 @@ class HostedSource extends Source { |
return description; |
} |
- Future<List<Package>> getCachedPackages() { |
- return defer(() { |
- var cacheDir = path.join(systemCacheRoot, |
- _getSourceDirectory(_defaultUrl)); |
- if (!dirExists(cacheDir)) return []; |
- |
- return listDir(path.join(cacheDir)).then((entries) { |
- return entries.map((entry) => |
- new Package.load(null, entry, systemCache.sources)); |
- }); |
- }); |
+ List<Package> getCachedPackages() { |
+ var cacheDir = path.join(systemCacheRoot, |
+ _getSourceDirectory(_defaultUrl)); |
+ if (!dirExists(cacheDir)) return []; |
+ |
+ return listDir(path.join(cacheDir)).map((entry) => |
+ new Package.load(null, entry, systemCache.sources)); |
} |
/// When an error occurs trying to read something about [package] from [url], |