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

Unified Diff: utils/pub/http.dart

Issue 12042053: Get rid of unneeded Future.immediate() calls. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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: utils/pub/http.dart
diff --git a/utils/pub/http.dart b/utils/pub/http.dart
index 0a2bf2eeddc009ba00c43754822e5c057e717b73..e148418e686501496dd26f2617b344ce090370cc 100644
--- a/utils/pub/http.dart
+++ b/utils/pub/http.dart
@@ -50,9 +50,7 @@ class PubHttpClient extends http.BaseClient {
var status = streamedResponse.statusCode;
// 401 responses should be handled by the OAuth2 client. It's very
// unlikely that they'll be returned by non-OAuth2 requests.
- if (status < 400 || status == 401) {
- return new Future.immediate(streamedResponse);
- }
+ if (status < 400 || status == 401) return streamedResponse;
return http.Response.fromStream(streamedResponse).then((response) {
throw new PubHttpException(response);
« utils/pub/entrypoint.dart ('K') | « utils/pub/git_source.dart ('k') | utils/pub/io.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698