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

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

Issue 13008021: Add optional writeAll separator argument. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 9 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 | « sdk/lib/core/string_sink.dart ('k') | sdk/lib/io/io_sink.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/io/http_impl.dart
diff --git a/sdk/lib/io/http_impl.dart b/sdk/lib/io/http_impl.dart
index c1272d3e12a7bb28d34e22eef687cb07e2ed1b25..1de89c4c762b9e7fb367ceedd342bfbc60b1defc 100644
--- a/sdk/lib/io/http_impl.dart
+++ b/sdk/lib/io/http_impl.dart
@@ -375,8 +375,16 @@ abstract class _HttpOutboundMessage<T> implements IOSink {
_ioSink.write(string);
}
- void writeAll(Iterable objects) {
- for (Object obj in objects) write(obj);
+ void writeAll(Iterable objects, [String separator = ""]) {
+ bool isFirst = true;
+ for (Object obj in objects) {
+ if (isFirst) {
+ isFirst = false;
+ } else {
+ if (separator != "") write(separator);
+ }
+ write(obj);
+ }
}
void writeln([Object obj = ""]) {
@@ -1635,7 +1643,9 @@ class _DetachedSocket extends Stream<List<int>> implements Socket {
void writeCharCode(int charCode) => _socket.writeCharCode(charCode);
- void writeAll(Iterable objects) => _socket.writeAll(objects);
+ void writeAll(Iterable objects, [String separator = ""]) {
+ _socket.writeAll(objects, separator);
+ }
void writeBytes(List<int> bytes) => _socket.writeBytes(bytes);
« no previous file with comments | « sdk/lib/core/string_sink.dart ('k') | sdk/lib/io/io_sink.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698