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

Unified Diff: sdk/lib/io/io_sink.dart

Issue 1263963003: Fix some TODOs (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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 | « runtime/lib/string_buffer_patch.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/io_sink.dart
diff --git a/sdk/lib/io/io_sink.dart b/sdk/lib/io/io_sink.dart
index 78c15fa83ca51fb21091a2eb965152f7452d0ae8..89cd586cafbb14575bdc5b4a19f042526d2886ca 100644
--- a/sdk/lib/io/io_sink.dart
+++ b/sdk/lib/io/io_sink.dart
@@ -273,18 +273,7 @@ class _IOSinkImpl extends _StreamSinkImpl<List<int>> implements IOSink {
}
void write(Object obj) {
- // This comment is copied from runtime/lib/string_buffer_patch.dart.
- // TODO(srdjan): The following four lines could be replaced by
- // '$obj', but apparently this is too slow on the Dart VM.
- String string;
- if (obj is String) {
- string = obj;
- } else {
- string = obj.toString();
- if (string is! String) {
- throw new ArgumentError('toString() did not return a string');
- }
- }
+ String string = '$obj';
if (string.isEmpty) return;
add(_encoding.encode(string));
}
« no previous file with comments | « runtime/lib/string_buffer_patch.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698