Simplify id-literal?, avoid some consing.

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

View file

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

View file

@ -284,7 +284,9 @@
report report
(and (not= op :db/add) (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" (raise "id-literals are resolved for :db/add only"
{:error :transact/syntax {:error :transact/syntax
:op entity }) :op entity })