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

Method chunkIteratorSeq

src/jvm/clojure/lang/RT.java:536–549  ·  view source on GitHub ↗
(final Iterator iter)

Source from the content-addressed store, hash-verified

534
535private static final int CHUNK_SIZE = 32;
536public static ISeq chunkIteratorSeq(final Iterator iter){
537 if(iter.hasNext()) {
538 return new LazySeq(new AFn() {
539 public Object invoke() {
540 Object[] arr = new Object[CHUNK_SIZE];
541 int n = 0;
542 while(iter.hasNext() && n < CHUNK_SIZE)
543 arr[n++] = iter.next();
544 return new ChunkedCons(new ArrayChunk(arr, 0, n), chunkIteratorSeq(iter));
545 }
546 });
547 }
548 return null;
549}
550
551static public ISeq seq(Object coll){
552 if(coll instanceof ASeq)

Callers 2

invokeMethod · 0.95
seqFromMethod · 0.95

Calls 1

hasNextMethod · 0.45

Tested by

no test coverage detected