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

Method without

src/jvm/clojure/lang/PersistentArrayMap.java:270–284  ·  view source on GitHub ↗
(Object key)

Source from the content-addressed store, hash-verified

268}
269
270public IPersistentMap without(Object key){
271 int i = indexOf(key);
272 if(i >= 0) //have key, will remove
273 {
274 int newlen = array.length - 2;
275 if(newlen == 0)
276 return empty();
277 Object[] newArray = new Object[newlen];
278 System.arraycopy(array, 0, newArray, 0, i);
279 System.arraycopy(array, i+2, newArray, i, newlen - i);
280 return create(newArray);
281 }
282 //don't have key, no op
283 return this;
284}
285
286public IPersistentMap empty(){
287 return (IPersistentMap) EMPTY.withMeta(meta());

Callers

nothing calls this directly

Calls 3

indexOfMethod · 0.95
emptyMethod · 0.95
createMethod · 0.95

Tested by

no test coverage detected