File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
deps/db/src/logseq/db/common Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 7474 (d/entity db eid)))
7575 (d/entity db eid)))
7676
77+ (defn unsafe->Entity
78+ " Faster verison of d/entity without checking e exists.
79+ Only use it in performance-critical areas and where the existence of 'e' is confirmed."
80+ [db e]
81+ {:pre [(pos-int? e)]}
82+ (Entity. db e (volatile! false ) (volatile! {})))
83+
7784(defn db-based-graph?
7885 " Whether the current graph is db-only"
7986 [db]
Original file line number Diff line number Diff line change 294294 (let [refs-count? (and (coll? sorting) (some (fn [m] (= (:id m) :block.temp/refs-count )) sorting))
295295 exclude-ids (when db-based? (get-exclude-page-ids db))]
296296 (keep (fn [d]
297- (let [e (d/ entity db (:e d))]
297+ (let [e (entity-plus/unsafe->Entity db (:e d))]
298298 (when-not (if db-based?
299299 (exclude-ids (:db/id e))
300300 (or (ldb/hidden-or-internal-tag? e)
You can’t perform that action at this time.
0 commit comments