# | Line 331 | Line 331 | public class IteratorMicroBenchmark { | |
---|---|---|
331 | x.toArray(a); | |
332 | for (Object o : a) | |
333 | sum[0] += (Integer) o; | |
334 | + | check.sum(sum[0]);}}}, |
335 | + | new Job(klazz + " .toArray(empty)") { |
336 | + | public void work() throws Throwable { |
337 | + | Integer[] empty = new Integer[0]; |
338 | + | int[] sum = new int[1]; |
339 | + | for (int i = 0; i < iterations; i++) { |
340 | + | sum[0] = 0; |
341 | + | for (Integer o : x.toArray(empty)) |
342 | + | sum[0] += o; |
343 | check.sum(sum[0]);}}}); | |
344 | } | |
345 |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |