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

Unified Diff: pkg/serialization/lib/src/format.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/format.dart
diff --git a/pkg/serialization/lib/src/format.dart b/pkg/serialization/lib/src/format.dart
index 68f609453db5b87c860f57cd3fdb3da3b14f7cd9..4e57384502097f09cc440881a4fc3057d4ffc40c 100644
--- a/pkg/serialization/lib/src/format.dart
+++ b/pkg/serialization/lib/src/format.dart
@@ -187,7 +187,7 @@ class SimpleJsonFormat extends Format {
var rules = reader.selfDescribing ? data[RULES] : null;
var actualData = reader.selfDescribing ? data[DATA] : data;
reader.readRules(rules);
- var ruleData = new List(reader.rules.length).map((x) => []).toList();
+ var ruleData = new List.generate(reader.rules.length, (_) => []);
var top = recursivelyFixUp(actualData, reader, ruleData);
result["data"] = ruleData;
result["roots"] = [top];
@@ -257,7 +257,7 @@ class SimpleFlatFormat extends Format {
}
result[0] = w.serializedRules();
result[1] = flatData;
- result[2] = new List();
+ result[2] = [];
w._rootReferences().forEach((x) => x.writeToList(result[2]));
return result;
}

Powered by Google App Engine
This is Rietveld 408576698