public void InfiniteListRun() { var infiniteList = new ThreeDimensionalList <TestItem>(); for (int x = -64; x < 64; x++) { for (int y = -128; y < 128; y++) { for (int z = -64; z < 64; z++) { if (x % 3 == 0 || x % 5 == 0 || x % 2 == 0) { if (y % 3 == 0 || y % 4 == 0 || y % 6 == 0 || y % 7 == 0) { if (z % 11 != 0) { infiniteList[x, y, z] = new TestItem { Id = x * y / z, Offset = x * y * z }; } } } } } } }
public Collection3DVsInfiniteList() { var collection = new Collection3D <TestItem>(); for (int x = -64; x < 32; x++) { for (int y = -128; y < 64; y++) { for (int z = -64; z < 64; z++) { if (x % 3 == 0 || x % 5 == 0 || x % 2 == 0) { if (y % 3 == 0 || y % 4 == 0 || y % 6 == 0 || y % 7 == 0) { if (z % 11 != 0) { collection[x, y, z] = new TestItem { Id = x * y / z, Offset = x * y * z }; } } } } } } var threeDimensionalList = new ThreeDimensionalList <TestItem>(); for (int x = -64; x < 32; x++) { for (int y = -128; y < 64; y++) { for (int z = -64; z < 64; z++) { if (x % 3 == 0 || x % 5 == 0 || x % 2 == 0) { if (y % 3 == 0 || y % 4 == 0 || y % 6 == 0 || y % 7 == 0) { if (z % 11 != 0) { collection[x, y, z] = new TestItem { Id = x * y / z, Offset = x * y * z }; } } } } } } _rCollection3D = collection; _r3DimensionalList = threeDimensionalList; }