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

Unified Diff: sdk/lib/collection/list.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/collection/collections.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/list.dart
diff --git a/sdk/lib/collection/list.dart b/sdk/lib/collection/list.dart
index 8c9dcd086dde71344cc7b55f95ec5f2ba805883e..4df545a4ef62479a21719096869bb729f5a884ae 100644
--- a/sdk/lib/collection/list.dart
+++ b/sdk/lib/collection/list.dart
@@ -181,9 +181,9 @@ abstract class ListMixin<E> implements List<E> {
return max;
}
- String join([String separator]) {
+ String join([String separator = ""]) {
int length = this.length;
- if (separator != null && !separator.isEmpty) {
+ if (!separator.isEmpty) {
if (length == 0) return "";
String first = "${this[0]}";
if (length != this.length) {
@@ -192,7 +192,7 @@ abstract class ListMixin<E> implements List<E> {
StringBuffer buffer = new StringBuffer(first);
for (int i = 1; i < length; i++) {
buffer.write(separator);
- buffer.write("${this[i]}");
+ buffer.write(this[i]);
if (length != this.length) {
throw new ConcurrentModificationError(this);
}
@@ -201,7 +201,7 @@ abstract class ListMixin<E> implements List<E> {
} else {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < length; i++) {
- buffer.write("${this[i]}");
+ buffer.write(this[i]);
if (length != this.length) {
throw new ConcurrentModificationError(this);
}
« no previous file with comments | « sdk/lib/collection/collections.dart ('k') | sdk/lib/core/iterable.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698