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

Unified Diff: runtime/vm/snapshot_test.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: runtime/vm/snapshot_test.dart
diff --git a/runtime/vm/snapshot_test.dart b/runtime/vm/snapshot_test.dart
index b0bdc88d20d26e62899f5980f90d46e485408f88..9742c38bc90f12b031d21898158b804d65ac9ab2 100644
--- a/runtime/vm/snapshot_test.dart
+++ b/runtime/vm/snapshot_test.dart
@@ -105,7 +105,7 @@ class Towers {
List<TowersDisk> piles;
int movesDone;
Towers(int disks)
- : piles = new List<TowersDisk>.fixedLength(3), movesDone = 0 {
+ : piles = new List<TowersDisk>(3), movesDone = 0 {
build(0, disks);
}
@@ -178,7 +178,7 @@ class SieveBenchmark extends BenchmarkBase {
static int sieve(int size) {
int primeCount = 0;
- List<bool> flags = new List<bool>.fixedLength(size + 1);
+ List<bool> flags = new List<bool>(size + 1);
for (int i = 1; i < size; i++) flags[i] = true;
for (int i = 2; i < size; i++) {
if (flags[i]) {
@@ -236,7 +236,7 @@ class Permute {
int permute(int size) {
permuteCount = 0;
- List<int> list = new List<int>.fixedLength(size);
+ List<int> list = new List<int>(size);
for (int i = 1; i < size; i++) list[i] = i - 1;
doPermute(size - 1, list);
return permuteCount;
@@ -299,10 +299,10 @@ class Queens {
}
static void queens() {
- List<bool> a = new List<bool>.fixedLength(9);
- List<bool> b = new List<bool>.fixedLength(17);
- List<bool> c = new List<bool>.fixedLength(15);
- List<int> x = new List<int>.fixedLength(9);
+ List<bool> a = new List<bool>(9);
+ List<bool> b = new List<bool>(17);
+ List<bool> c = new List<bool>(15);
+ List<int> x = new List<int>(9);
b[1] = false;
for (int i = -7; i <= 16; i++) {
if ((i >= 1) && (i <= 8)) a[i] = true;
@@ -408,7 +408,7 @@ class SortData {
SortData(int length) {
Random r = new Random();
- list = new List<int>.fixedLength(length);
+ list = new List<int>(length);
for (int i = 0; i < length; i++) list[i] = r.random();
int min, max;
@@ -1319,7 +1319,7 @@ message_test_main() {
List local_list1 = ["Hello", "World", "Hello", 0xffffffffff];
List local_list2 = [null, local_list1, local_list1 ];
List local_list3 = [local_list2, 2.0, true, false, 0xffffffffff];
- List sendObject = new List.fixedLength(5);
+ List sendObject = new List(5);
sendObject[0] = local_list1;
sendObject[1] = sendObject;
sendObject[2] = local_list2;
@@ -1443,7 +1443,7 @@ class MandelbrotState {
MandelbrotState() {
_result = new List<List<int>>(N);
- _lineProcessedBy = new List<LineProcessorClient>.fixedLength(N);
+ _lineProcessedBy = new List<LineProcessorClient>(N);
_sent = 0;
_missing = N;
_validated = new Completer<bool>();
@@ -1523,7 +1523,7 @@ class LineProcessorClient {
List<int> processLine(int y) {
double inverseN = 2.0 / N;
double Civ = y * inverseN - 1.0;
- List<int> result = new List<int>.fixedLength(N);
+ List<int> result = new List<int>(N);
for (int x = 0; x < N; x++) {
double Crv = x * inverseN - 1.5;

Powered by Google App Engine
This is Rietveld 408576698