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

Method compareTo

src/jvm/clojure/lang/APersistentVector.java:494–507  ·  view source on GitHub ↗
(Object o)

Source from the content-addressed store, hash-verified

492}
493
494public int compareTo(Object o){
495 IPersistentVector v = (IPersistentVector) o;
496 if(count() < v.count())
497 return -1;
498 else if(count() > v.count())
499 return 1;
500 for(int i = 0; i < count(); i++)
501 {
502 int c = Util.compare(nth(i),v.nth(i));
503 if(c != 0)
504 return c;
505 }
506 return 0;
507}
508
509static class Seq extends ASeq implements IndexedSeq, IReduce{
510 //todo - something more efficient

Callers

nothing calls this directly

Calls 4

compareMethod · 0.95
nthMethod · 0.95
countMethod · 0.65
nthMethod · 0.65

Tested by

no test coverage detected