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

Method append

src/jvm/clojure/lang/PersistentTreeMap.java:383–415  ·  view source on GitHub ↗
(Node left, Node right)

Source from the content-addressed store, hash-verified

381}
382
383static Node append(Node left, Node right){
384 if(left == null)
385 return right;
386 else if(right == null)
387 return left;
388 else if(left instanceof Red)
389 {
390 if(right instanceof Red)
391 {
392 Node app = append(left.right(), right.left());
393 if(app instanceof Red)
394 return red(app.key, app.val(),
395 red(left.key, left.val(), left.left(), app.left()),
396 red(right.key, right.val(), app.right(), right.right()));
397 else
398 return red(left.key, left.val(), left.left(), red(right.key, right.val(), app, right.right()));
399 }
400 else
401 return red(left.key, left.val(), left.left(), append(left.right(), right));
402 }
403 else if(right instanceof Red)
404 return red(right.key, right.val(), append(left, right.left()), right.right());
405 else //black/black
406 {
407 Node app = append(left.right(), right.left());
408 if(app instanceof Red)
409 return red(app.key, app.val(),
410 black(left.key, left.val(), left.left(), app.left()),
411 black(right.key, right.val(), app.right(), right.right()));
412 else
413 return balanceLeftDel(left.key, left.val(), left.left(), black(right.key, right.val(), app, right.right()));
414 }
415}
416
417static Node balanceLeftDel(Object key, Object val, Node del, Node right){
418 if(del instanceof Red)

Callers 15

removeMethod · 0.95
maybeEmitFIAdapterMethod · 0.80
getTypeStringForArgsMethod · 0.80
CompilerClass · 0.80
mungeMethod · 0.80
demungeMethod · 0.80
primInterfaceMethod · 0.80
readMethod · 0.80
readLineMethod · 0.80
readTokenMethod · 0.80
readNumberMethod · 0.80

Calls 9

redMethod · 0.95
valMethod · 0.95
leftMethod · 0.95
rightMethod · 0.95
blackMethod · 0.95
balanceLeftDelMethod · 0.95
valMethod · 0.65
rightMethod · 0.45
leftMethod · 0.45

Tested by

no test coverage detected