MCPcopy Create free account
hub / github.com/TanStack/db / takeFromRight

Method takeFromRight

packages/db/src/utils/btree.ts:592–604  ·  view source on GitHub ↗
(rhs: BNode<K, V>)

Source from the content-addressed store, hash-verified

590 }
591
592 takeFromRight(rhs: BNode<K, V>) {
593 // Reminder: parent node must update its copy of key for this node
594 // assert: neither node is shared
595 // assert rhs.keys.length > (maxNodeSize/2 && this.keys.length<maxNodeSize)
596 let v = this.values
597 if (rhs.values === undefVals) {
598 if (v !== undefVals) v.push(undefined as any)
599 } else {
600 v = this.reifyValues()
601 v.push(rhs.values.shift()!)
602 }
603 this.keys.push(rhs.keys.shift()!)
604 }
605
606 takeFromLeft(lhs: BNode<K, V>) {
607 // Reminder: parent node must update its copy of key for this node

Callers 1

setMethod · 0.45

Calls 1

reifyValuesMethod · 0.95

Tested by

no test coverage detected