MCPcopy Create free account
hub / github.com/ReadyTalk/avian / first

Method first

classpath/avian/PersistentSet.java:434–452  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

432 }
433
434 public Path<T> first() {
435 if (root == NullNode) return null;
436
437 Node<T> newRoot = new Node(root);
438 Cell<Node<T>> ancestors = null;
439
440 Node<T> old = root;
441 Node<T> new_ = newRoot;
442 while (old.left != NullNode) {
443 ancestors = new Cell(new_, ancestors);
444
445 old = old.left;
446 new_ = new_.left = new Node(old);
447 }
448
449 return new Path(true, new_,
450 new PersistentSet(newRoot, comparator, size),
451 ancestors);
452 }
453
454 public Path<T> last() {
455 if (root == NullNode) return null;

Callers 1

iteratorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected