[nop] Misc housekeeping

This commit is contained in:
Peter Taoussanis 2022-11-23 09:59:42 +01:00
parent 16c05c0730
commit 9e18febc60

View file

@ -33,6 +33,9 @@
;;;; TODO ;;;; TODO
;; - Performance would benefit from ^:static support / direct linking / etc. ;; - Performance would benefit from ^:static support / direct linking / etc.
;; - Counts could actually be unsigned (e.g. -sm as [0,255] instead of [-128,127]).
;; Would require a breaking change (e.g. version 2 header), probably not worth
;; the effort.
;;;; Nippy data format ;;;; Nippy data format
;; * 4-byte header (Nippy v2.x+) (may be disabled but incl. by default) [1] ;; * 4-byte header (Nippy v2.x+) (may be disabled but incl. by default) [1]
@ -407,18 +410,20 @@
(defn- init-allowlist [action default incl-legacy?] (defn- init-allowlist [action default incl-legacy?]
(let [allowlist-base (let [allowlist-base
(or (or
(when-let [s (or (when-let [s
(enc/get-sys-val (get-in ids [action :base :prop]) (get-in ids [action :base :env])) (or
(when incl-legacy? (do (enc/get-sys-val (get-in ids [action :base :prop]) (get-in ids [action :base :env])))
(enc/get-sys-val (get-in ids [:legacy :base :prop]) (get-in ids [:legacy :base :env]))))] (when incl-legacy? (enc/get-sys-val (get-in ids [:legacy :base :prop]) (get-in ids [:legacy :base :env]))))]
(if (allow-and-record? s) s (split-class-names>set s))) (if (allow-and-record? s) s (split-class-names>set s)))
default) default)
allowlist-add allowlist-add
(when-let [s (or (when-let [s
(enc/get-sys-val (get-in ids [action :add :prop]) (get-in ids [action :add :env])) (or
(when incl-legacy? (do (enc/get-sys-val (get-in ids [action :add :prop]) (get-in ids [action :add :env])))
(enc/get-sys-val (get-in ids [:legacy :add :prop]) (get-in ids [:legacy :add :env]))))] (when incl-legacy? (enc/get-sys-val (get-in ids [:legacy :add :prop]) (get-in ids [:legacy :add :env]))))]
(if (allow-and-record? s) s (split-class-names>set s)))] (if (allow-and-record? s) s (split-class-names>set s)))]
(if (and allowlist-base allowlist-add) (if (and allowlist-base allowlist-add)