MCPcopy Index your code
hub / github.com/clojure/clojure / reduce

Method reduce

src/jvm/clojure/lang/PersistentArrayMap.java:412–424  ·  view source on GitHub ↗
(IFn f)

Source from the content-addressed store, hash-verified

410 }
411
412 public Object reduce(IFn f) {
413 if(i < array.length) {
414 Object acc = MapEntry.create(array[i], array[i+1]);
415 for(int j=i+2;j < array.length;j+=2){
416 acc = f.invoke(acc, MapEntry.create(array[j], array[j+1]));
417 if(RT.isReduced(acc))
418 return ((IDeref)acc).deref();
419 }
420 return acc;
421 } else {
422 return f.invoke();
423 }
424 }
425
426 public Object reduce(IFn f, Object init) {
427 Object acc = init;

Callers

nothing calls this directly

Calls 4

createMethod · 0.95
isReducedMethod · 0.95
invokeMethod · 0.65
derefMethod · 0.65

Tested by

no test coverage detected