ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/extra166y/ApplyDemo.java
(Generate patch)

Comparing jsr166/src/test/extra166y/ApplyDemo.java (file contents):
Revision 1.1 by dl, Sun Nov 1 22:00:35 2009 UTC vs.
Revision 1.2 by jsr166, Mon Nov 16 04:16:42 2009 UTC

# Line 16 | Line 16 | public class ApplyDemo {
16       */
17      static <T> void seqApply(T[] array, Ops.Procedure<T> f) {
18          int n = array.length;
19 <        for (int i = 0; i < n; ++i)
19 >        for (int i = 0; i < n; ++i)
20              f.op(array[i]);
21      }
22  
# Line 24 | Line 24 | public class ApplyDemo {
24       * A sample procedure to apply
25       */
26      static final class Proc implements Ops.Procedure<Rand> {
27 <        public void op(Rand x) {
27 >        public void op(Rand x) {
28              for (int k = 0; k < (1 << 10); ++k)
29                  x.next();
30          }
# Line 41 | Line 41 | public class ApplyDemo {
41      public static void test() throws Exception {
42          int n = 1 << 18;
43          Rand[] array = new Rand[n];
44 <        for (int i = 0; i < n; ++i)
44 >        for (int i = 0; i < n; ++i)
45              array[i] = new Rand(i);
46          final Proc proc = new Proc();
47          long last, now;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines