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

Unified Diff: sdk/lib/_collection_dev/iterable.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
Index: sdk/lib/_collection_dev/iterable.dart
diff --git a/sdk/lib/_collection_dev/iterable.dart b/sdk/lib/_collection_dev/iterable.dart
index e8a6a956ac1fbb62d61f8260cf789b694dc8e042..69181b9aa497451d6ad53723a968407c02f3c0af 100644
--- a/sdk/lib/_collection_dev/iterable.dart
+++ b/sdk/lib/_collection_dev/iterable.dart
@@ -166,9 +166,9 @@ abstract class ListIterable<E> extends Iterable<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 = "${elementAt(0)}";
if (length != this.length) {
@@ -177,7 +177,7 @@ abstract class ListIterable<E> extends Iterable<E> {
StringBuffer buffer = new StringBuffer(first);
for (int i = 1; i < length; i++) {
buffer.write(separator);
- buffer.write("${elementAt(i)}");
+ buffer.write(elementAt(i));
if (length != this.length) {
throw new ConcurrentModificationError(this);
}
@@ -186,7 +186,7 @@ abstract class ListIterable<E> extends Iterable<E> {
} else {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < length; i++) {
- buffer.write("${elementAt(i)}");
+ buffer.write(elementAt(i));
if (length != this.length) {
throw new ConcurrentModificationError(this);
}
@@ -667,7 +667,7 @@ class EmptyIterable<E> extends Iterable<E> {
E max([int compare(E a, E b)]) => null;
- String join([String separator]) => "";
+ String join([String separator = ""]) => "";
Iterable<E> where(bool test(E element)) => this;
« no previous file with comments | « samples/swarm/swarm_ui_lib/observable/observable.dart ('k') | sdk/lib/_internal/compiler/implementation/code_buffer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698