From dbf398e6d0c6c13685552e4a84b66b853856060a Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Tue, 23 Oct 2007 17:22:10 -0600 Subject: [PATCH] fix loops to interate ITERATION_COUNT times instead of ITERATION_COUNT - 1 --- test/Memory.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/Memory.java b/test/Memory.java index 4f6b30b645..24b837c716 100644 --- a/test/Memory.java +++ b/test/Memory.java @@ -46,7 +46,7 @@ public class Memory { traceFunc("testArray()"); Item[] items = new Item[1750]; - for (int iter=1; iter < ITERATION_COUNT; iter++) { + for (int iter=0; iter < ITERATION_COUNT; iter++) { for (int i=0; i < 1000; i++) { items[i] = new Item(1); } @@ -84,7 +84,7 @@ public class Memory { private static final void testHashMap() { traceFunc("testHashMap()"); HashMap items = new HashMap(); - for (int iter=1; iter < ITERATION_COUNT; iter++) { + for (int iter=0; iter < ITERATION_COUNT; iter++) { for (int i=0; i < 1000; i++) { items.put(i, new Item(1)); } @@ -110,7 +110,7 @@ public class Memory { private static final void testLinkedList() { traceFunc("testLinkedList()"); LinkedList items = new LinkedList(); - for (int iter=1; iter < ITERATION_COUNT; iter++) { + for (int iter=0; iter < ITERATION_COUNT; iter++) { for (int i=0; i < 1000; i++) { items.add(new Item(1)); } @@ -144,7 +144,7 @@ public class Memory { return r; } }); - for (int iter=1; iter < ITERATION_COUNT; iter++) { + for (int iter=0; iter < ITERATION_COUNT; iter++) { for (int i=0; i < 1000; i++) { items.add(new Item(1)); }