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

Unified Diff: pkg/serialization/lib/src/serialization_helpers.dart

Issue 12328104: Change new List(n) to return fixed length list. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Merge to head. 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
Index: pkg/serialization/lib/src/serialization_helpers.dart
diff --git a/pkg/serialization/lib/src/serialization_helpers.dart b/pkg/serialization/lib/src/serialization_helpers.dart
index 9568c24dee7db223fe32fb46df89a1c06c8d0da3..6ce5f7642f2405cf0000802385ead4a6ead3017b 100644
--- a/pkg/serialization/lib/src/serialization_helpers.dart
+++ b/pkg/serialization/lib/src/serialization_helpers.dart
@@ -20,10 +20,10 @@ doNothing(x) => x;
// TODO(alanknight): Remove once issue 5342 is resolved.
Iterable append(Iterable a, Iterable b) {
if (a == null) {
- return (b == null) ? [] : new List.from(b);
+ return (b == null) ? [] : new List.from(b, growable: true);
}
- if (b == null) return new List.from(a);
- var result = new List.from(a);
+ if (b == null) return new List.from(a, growable: true);
+ var result = new List.from(a, growable: true);
result.addAll(b);
return result;
}
@@ -132,7 +132,7 @@ values(x) {
mapValues(x, f) {
if (x is Set) return x.map(f).toSet();
- if (x is Iterable) return x.map(f).toList();
+ if (x is Iterable) return x.map(f).toList(growable: true);
if (x is Map) return new ListLikeIterable(x).map(f);
throw new ArgumentError("Invalid argument");
}

Powered by Google App Engine
This is Rietveld 408576698