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

Unified Diff: utils/pub/version_solver.dart

Issue 14070010: Refactor Future constructors. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added co19 issue number. Created 7 years, 8 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 | « utils/pub/validator/utf8_readme.dart ('k') | utils/tests/pub/error_group_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/version_solver.dart
diff --git a/utils/pub/version_solver.dart b/utils/pub/version_solver.dart
index 5b055d87e86b92871a42ebfbe91de1249bec52c1..36569bab117366b6b7651e985ddaf16e533d49c2 100644
--- a/utils/pub/version_solver.dart
+++ b/utils/pub/version_solver.dart
@@ -97,7 +97,7 @@ class VersionSolver {
Future processNextWorkItem(_) {
while (true) {
// Stop if we are done.
- if (_work.isEmpty) return new Future.immediate(buildResults());
+ if (_work.isEmpty) return new Future.value(buildResults());
// If we appear to be stuck in a loop, then we probably have an unstable
// graph, bail. We guess this based on a rough heuristic that it should
@@ -284,8 +284,7 @@ class ChangeVersion implements WorkItem {
Version version) {
// If there is no version, it means no package, so no dependencies.
if (version == null) {
- return new Future<Map<String, PackageRef>>.immediate(
- <String, PackageRef>{});
+ return new Future<Map<String, PackageRef>>.value(<String, PackageRef>{});
}
var id = new PackageId(package, source, version, description);
@@ -475,7 +474,7 @@ class PubspecCache {
Future<Pubspec> load(PackageId id) {
// Complete immediately if it's already cached.
if (_pubspecs.containsKey(id)) {
- return new Future<Pubspec>.immediate(_pubspecs[id]);
+ return new Future<Pubspec>.value(_pubspecs[id]);
}
return id.describe().then((pubspec) {
« no previous file with comments | « utils/pub/validator/utf8_readme.dart ('k') | utils/tests/pub/error_group_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698