🐛 Fix ObjectsMap CLJS negative cache keyed on 'key' fn instead of 'k'

In the CLJS -lookup implementation, when a key is absent from data the
negative cache entry was stored under 'key' (the built-in map-entry
key function) rather than the 'k' parameter.  As a result every
subsequent lookup of any missing key bypassed the cache and repeated
the full lookup path, making the negative-cache optimization entirely
ineffective.

Signed-off-by: Andrey Antukh <niwi@niwi.nz>
This commit is contained in:
Andrey Antukh 2026-04-14 12:41:00 +00:00
parent 2b67e114b6
commit 6da39bc9c7

View File

@ -278,7 +278,7 @@
(set! (.-cache this) (c/-assoc cache k v))
v)
(do
(set! (.-cache this) (assoc cache key nil))
(set! (.-cache this) (assoc cache k nil))
nil))))
(-lookup [this k not-found]