| 392 | public Spliterator spliterator(){return rangedSpliterator(0,count());} |
| 393 | |
| 394 | public Object reduce(IFn f){ |
| 395 | Object init; |
| 396 | if (cnt > 0) |
| 397 | init = arrayFor(0)[0]; |
| 398 | else |
| 399 | return f.invoke(); |
| 400 | int step = 0; |
| 401 | for(int i=0;i<cnt;i+=step){ |
| 402 | Object[] array = arrayFor(i); |
| 403 | for(int j = (i==0)?1:0;j<array.length;++j){ |
| 404 | init = f.invoke(init,array[j]); |
| 405 | if(RT.isReduced(init)) |
| 406 | return ((IDeref)init).deref(); |
| 407 | } |
| 408 | step = array.length; |
| 409 | } |
| 410 | return init; |
| 411 | } |
| 412 | |
| 413 | public Object reduce(IFn f, Object init){ |
| 414 | int step = 0; |