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

Unified Diff: sdk/lib/async/future.dart

Issue 1177343004: Add Stream.empty. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add test, fix impl. Created 5 years, 6 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 | « no previous file | sdk/lib/async/stream.dart » ('j') | sdk/lib/async/stream.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/async/future.dart
diff --git a/sdk/lib/async/future.dart b/sdk/lib/async/future.dart
index 5d6a65009a4afae64ff5d150d7d8816bc876526f..13de367c5aa6c39af4adf7c64765635211f247c0 100644
--- a/sdk/lib/async/future.dart
+++ b/sdk/lib/async/future.dart
@@ -181,6 +181,7 @@ abstract class Future<T> {
* Use [Completer] to create a Future and complete it later.
*/
factory Future.value([value]) {
+ if (value == null) return _nullFuture;
sra1 2015/06/15 16:17:40 What is the purpose of this change? I think this
Lasse Reichstein Nielsen 2015/06/15 16:24:42 Ack, true. The purpose is entirely to save some sp
Lasse Reichstein Nielsen 2015/06/16 09:25:12 Rolling this change back.
return new _Future<T>.immediate(value);
}
« no previous file with comments | « no previous file | sdk/lib/async/stream.dart » ('j') | sdk/lib/async/stream.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698