Update btrees.nim (#14916)
This commit is contained in:
parent
21b3ca636f
commit
842efab8ae
1 changed files with 3 additions and 0 deletions
|
|
@ -79,6 +79,9 @@ proc insert[Key, Val](h: Node[Key, Val], key: Key, val: Val): Node[Key, Val] =
|
|||
var j = 0
|
||||
if not h.isInternal:
|
||||
while j < h.entries:
|
||||
if eq(key, h.keys[j]):
|
||||
h.vals[j] = val
|
||||
return
|
||||
if less(key, h.keys[j]): break
|
||||
inc j
|
||||
for i in countdown(h.entries, j+1):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue