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

Method assoc

src/jvm/clojure/lang/PersistentTreeMap.java:126–137  ·  view source on GitHub ↗
(Object key, Object val)

Source from the content-addressed store, hash-verified

124}
125
126public PersistentTreeMap assoc(Object key, Object val){
127 Box found = new Box(null);
128 Node t = add(tree, key, val, found);
129 if(t == null) //null == already contains key
130 {
131 Node foundNode = (Node) found.val;
132 if(foundNode.val() == val) //note only get same collection on identity of val, not equals()
133 return this;
134 return new PersistentTreeMap(comp, replace(tree, key, val), _count, meta());
135 }
136 return new PersistentTreeMap(comp, t.blacken(), _count + 1, meta());
137}
138
139
140public PersistentTreeMap without(Object key){

Callers 2

createMethod · 0.95
registerArgMethod · 0.95

Calls 5

addMethod · 0.95
valMethod · 0.95
replaceMethod · 0.95
metaMethod · 0.95
blackenMethod · 0.95

Tested by

no test coverage detected