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

Unified Diff: sdk/lib/collection/collections.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/_internal/compiler/implementation/code_buffer.dart ('k') | sdk/lib/core/iterable.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/collection/collections.dart
diff --git a/sdk/lib/collection/collections.dart b/sdk/lib/collection/collections.dart
index 5d8431743f585b374bf0a0a76430ca4d10fb6fdb..16290e57949335947138e6c74c2225a9702754a8 100644
--- a/sdk/lib/collection/collections.dart
+++ b/sdk/lib/collection/collections.dart
@@ -274,20 +274,8 @@ class IterableMixinWorkaround {
}
static String join(Iterable iterable, [String separator]) {
- Iterator iterator = iterable.iterator;
- if (!iterator.moveNext()) return "";
StringBuffer buffer = new StringBuffer();
- if (separator == null || separator == "") {
- do {
- buffer.write("${iterator.current}");
- } while (iterator.moveNext());
- } else {
- buffer.write("${iterator.current}");
- while (iterator.moveNext()) {
- buffer.write(separator);
- buffer.write("${iterator.current}");
- }
- }
+ buffer.writeAll(iterable, separator == null ? "" : separator);
return buffer.toString();
}
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/code_buffer.dart ('k') | sdk/lib/core/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698