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

Method rangedIterator

src/jvm/clojure/lang/PersistentVector.java:292–319  ·  view source on GitHub ↗
(final int start, final int end)

Source from the content-addressed store, hash-verified

290}
291
292@Override
293Iterator rangedIterator(final int start, final int end){
294 return new Iterator(){
295 int i = start;
296 int base = i - (i%32);
297 Object[] array = (start < count())?arrayFor(i):null;
298
299 public boolean hasNext(){
300 return i < end;
301 }
302
303 public Object next(){
304 if(i < end) {
305 if(i-base == 32){
306 array = arrayFor(i);
307 base += 32;
308 }
309 return array[i++ & 0x01f];
310 } else {
311 throw new NoSuchElementException();
312 }
313 }
314
315 public void remove(){
316 throw new UnsupportedOperationException();
317 }
318 };
319}
320
321public Iterator iterator(){return rangedIterator(0,count());}
322

Callers 2

iteratorMethod · 0.95
iteratorMethod · 0.45

Calls 2

countMethod · 0.95
arrayForMethod · 0.95

Tested by

no test coverage detected