fixes #25162; fixup 0f5732bc8c: withValue for immut tab wrong chk cond (#25163)

fixes #25162
ref https://github.com/nim-lang/Nim/pull/24825

(cherry picked from commit ff9cae896c)
This commit is contained in:
lit
2025-09-12 20:07:05 +08:00
committed by narimiran
parent 377b6cc6bf
commit 4c7ddcd79a

View File

@@ -707,7 +707,7 @@ template withValue*[A, B](t: Table[A, B], key: A,
mixin rawGet
var hc: Hash
var index = rawGet(t, key, hc)
if index > 0:
if index >= 0:
let value {.cursor, inject.} = t.data[index].val
body1
else: