From 4c7ddcd79a0e29126b9cdfcf13b3e9a9930cbecb Mon Sep 17 00:00:00 2001 From: lit Date: Fri, 12 Sep 2025 20:07:05 +0800 Subject: [PATCH] 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 ff9cae896ce900ac8e77ec9a51e09192653a1a49) --- lib/pure/collections/tables.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pure/collections/tables.nim b/lib/pure/collections/tables.nim index 04672c08a1..395b4b5975 100644 --- a/lib/pure/collections/tables.nim +++ b/lib/pure/collections/tables.nim @@ -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: