Skip to content

Commit

Permalink
fix: find-datom on empty-db
Browse files Browse the repository at this point in the history
  • Loading branch information
RCmerci committed Jul 20, 2024
1 parent 6b7d1eb commit 4eabbb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datascript/db.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@
cmp #?(:clj (.comparator ^clojure.lang.Sorted set) :cljs (.-comparator set))
from (components->pattern db index c0 c1 c2 c3 e0 tx0)
to (components->pattern db index c0 c1 c2 c3 emax txmax)
datom (first (set/seek (seq set) from))]
datom (when-let [set* (seq set)] (first (set/seek set* from)))]
(when (and (some? datom) (<= 0 (cmp to datom)))
datom)))

Expand Down

0 comments on commit 4eabbb8

Please sign in to comment.