Simplify id-literal?, avoid some consing.

This commit is contained in:
Richard Newman 2016-08-10 13:15:58 -07:00
parent b4112bbe52
commit 587959d1ff
2 changed files with 4 additions and 2 deletions

View file

@ -58,7 +58,7 @@
(->TempId part idx)))
(defn id-literal? [x]
(and (instance? TempId x)))
(instance? TempId x))
(defprotocol IClock
(now

View file

@ -284,7 +284,9 @@
report
(and (not= op :db/add)
(not (empty? (filter id-literal? [e a v]))))
(or (id-literal? e)
(id-literal? a)
(id-literal? v)))
(raise "id-literals are resolved for :db/add only"
{:error :transact/syntax
:op entity })