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

Method prefers

src/jvm/clojure/lang/MultiFn.java:105–120  ·  view source on GitHub ↗
(Object hierarchy, Object x, Object y)

Source from the content-addressed store, hash-verified

103}
104
105private boolean prefers(Object hierarchy, Object x, Object y) {
106 IPersistentSet xprefs = (IPersistentSet) getPreferTable().valAt(x);
107 if(xprefs != null && xprefs.contains(y))
108 return true;
109 for(ISeq ps = RT.seq(parents.invoke(hierarchy, y)); ps != null; ps = ps.next())
110 {
111 if(prefers(hierarchy, x, ps.first()))
112 return true;
113 }
114 for(ISeq ps = RT.seq(parents.invoke(hierarchy, x)); ps != null; ps = ps.next())
115 {
116 if(prefers(hierarchy, ps.first(), y))
117 return true;
118 }
119 return false;
120}
121
122private boolean isA(Object hierarchy, Object x, Object y) {
123 return RT.booleanCast(isa.invoke(hierarchy, x, y));

Callers 2

preferMethodMethod · 0.95
dominatesMethod · 0.95

Calls 7

getPreferTableMethod · 0.95
containsMethod · 0.95
seqMethod · 0.95
nextMethod · 0.95
firstMethod · 0.95
valAtMethod · 0.65
invokeMethod · 0.65

Tested by

no test coverage detected