Update btrees.nim (#14916)

This commit is contained in:
Dean Eigenmann
2020-07-06 10:23:42 +02:00
committed by GitHub
parent 21b3ca636f
commit 842efab8ae

View File

@@ -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):