summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorDean Eigenmann <7621705+decanus@users.noreply.github.com>2020-07-06 10:23:42 +0200
committerGitHub <noreply@github.com>2020-07-06 10:23:42 +0200
commit842efab8ae867f001d5043a773ee96a7087c2334 (patch)
tree6f9595ae320659f6969f6cc743d2e39041aeca22 /compiler
parent21b3ca636fa7eee53911ab134afe2805fd0bf47e (diff)
downloadNim-842efab8ae867f001d5043a773ee96a7087c2334.tar.gz
Update btrees.nim (#14916)
Diffstat (limited to 'compiler')
-rw-r--r--compiler/btrees.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler/btrees.nim b/compiler/btrees.nim
index 65edc54f3..18854d474 100644
--- a/compiler/btrees.nim
+++ b/compiler/btrees.nim
@@ -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):