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

Unified Diff: sdk/lib/collection/collections.dart

Issue 13945009: Make default argument to Iterable.join be "". (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 8 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/lib/js_array.dart ('k') | sdk/lib/collection/list.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 54c1fa9866cd07023bd25eb0633d7074420c3d96..f51d98daaabeb87b5ab5bb1613a0f12e4fd5cc6e 100644
--- a/sdk/lib/collection/collections.dart
+++ b/sdk/lib/collection/collections.dart
@@ -282,7 +282,7 @@ class IterableMixinWorkaround {
static String join(Iterable iterable, [String separator]) {
StringBuffer buffer = new StringBuffer();
- buffer.writeAll(iterable, separator == null ? "" : separator);
+ buffer.writeAll(iterable, separator);
return buffer.toString();
}
@@ -290,15 +290,15 @@ class IterableMixinWorkaround {
if (list.isEmpty) return "";
if (list.length == 1) return "${list[0]}";
StringBuffer buffer = new StringBuffer();
- if (separator == null || separator == "") {
+ if (separator.isEmpty) {
for (int i = 0; i < list.length; i++) {
- buffer.write("${list[i]}");
+ buffer.write(list[i]);
}
} else {
- buffer.write("${list[0]}");
+ buffer.write(list[0]);
for (int i = 1; i < list.length; i++) {
buffer.write(separator);
- buffer.write("${list[i]}");
+ buffer.write(list[i]);
}
}
return buffer.toString();
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/lib/js_array.dart ('k') | sdk/lib/collection/list.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698