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

Unified Diff: sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart

Issue 122463002: Fix version_negotiation_test timing out. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years 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/solver/dependency_queue.dart
diff --git a/sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart b/sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart
index c462120575050fbbd1c10ad7c171cb02e1ea51bc..42ca2992daf9380342662058dd87802a6e7ae8a1 100644
--- a/sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart
+++ b/sdk/lib/_internal/pub/lib/src/solver/dependency_queue.dart
@@ -125,18 +125,9 @@ class DependencyQueue {
/// versions available for it.
Future<int> _getNumVersions(PackageDep dep) {
// There is only ever one version of the root package.
- if (dep.isRoot) {
- return new Future.value(1);
- }
+ if (dep.isRoot) return new Future.value(1);
- return _solver.cache.getVersions(dep.toRef()).then((versions) {
- return versions.length;
- }).catchError((error, trace) {
- // If it fails for any reason, just treat that as no versions. This
- // will sort this reference higher so that we can traverse into it
- // and report the error more properly.
- log.solver("Could not get versions for $dep:\n$error\n\n$trace");
- return 0;
- });
+ return _solver.cache.getVersions(dep.toRef())
+ .then((versions) => versions.length);
}
}
« no previous file with comments | « no previous file | sdk/lib/_internal/pub/pub.status » ('j') | sdk/lib/_internal/pub/test/hosted/version_negotiation_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698