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

Unified Diff: sdk/lib/_collection_dev/iterable.dart

Issue 12226099: Fix List.map.join with no separator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 | « no previous file | tests/corelib/iterable_join_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_collection_dev/iterable.dart
diff --git a/sdk/lib/_collection_dev/iterable.dart b/sdk/lib/_collection_dev/iterable.dart
index 89b9e6d4aab3f32e32f475686353a3773d55d1b6..7510273a20e9720c13f08b1220589447b98d7ba0 100644
--- a/sdk/lib/_collection_dev/iterable.dart
+++ b/sdk/lib/_collection_dev/iterable.dart
@@ -279,7 +279,9 @@ class MappedListIterable<S, T> extends Iterable<T> {
throw new ConcurrentModificationError(_list);
}
for (int i = start + 1; i < end; i++) {
- buffer.add(separator);
+ if (separator != null && separator != "") {
+ buffer.add(separator);
+ }
buffer.add("${_f(_list[i])}");
if (_list.length != length) {
throw new ConcurrentModificationError(_list);
« no previous file with comments | « no previous file | tests/corelib/iterable_join_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698