Skip to content

Commit

Permalink
[nop] Misc housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
ptaoussanis committed May 10, 2023
1 parent fbd2527 commit 5218b20
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/taoensso/nippy.clj
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@

;;;; TODO
;; - 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.
;; - Could use different ids for pos/neg numbers, and thus encode both as unsigned

;;;; Nippy data format
;; * 4-byte header (Nippy v2.x+) (may be disabled but incl. by default) [1]
Expand Down Expand Up @@ -407,18 +411,20 @@
(defn- init-allowlist [action default incl-legacy?]
(let [allowlist-base
(or
(when-let [s (or
(enc/get-sys-val (get-in ids [action :base :prop]) (get-in ids [action :base :env]))
(when incl-legacy?
(enc/get-sys-val (get-in ids [:legacy :base :prop]) (get-in ids [:legacy :base :env]))))]
(when-let [s
(or
(do (enc/get-sys-val (get-in ids [action :base :prop]) (get-in ids [action :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)))
default)

allowlist-add
(when-let [s (or
(enc/get-sys-val (get-in ids [action :add :prop]) (get-in ids [action :add :env]))
(when incl-legacy?
(enc/get-sys-val (get-in ids [:legacy :add :prop]) (get-in ids [:legacy :add :env]))))]
(when-let [s
(or
(do (enc/get-sys-val (get-in ids [action :add :prop]) (get-in ids [action :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 (and allowlist-base allowlist-add)
Expand Down

0 comments on commit 5218b20

Please sign in to comment.