Revert 8e4cc07 (unnecessary, slower)
This commit is contained in:
parent
3addeed195
commit
05907403dc
1 changed files with 4 additions and 5 deletions
|
|
@ -94,11 +94,7 @@
|
||||||
(when-let [m# (meta x#)]
|
(when-let [m# (meta x#)]
|
||||||
(write-id s# ~id-meta)
|
(write-id s# ~id-meta)
|
||||||
(freeze-to-stream* m# s#))
|
(freeze-to-stream* m# s#))
|
||||||
(try (freeze-to-stream* x# s#)
|
(freeze-to-stream* x# s#)))
|
||||||
(catch java.lang.IllegalArgumentException _#
|
|
||||||
;; Use Clojure reader as final fallback (after custom extensions)
|
|
||||||
(write-id s# id-reader)
|
|
||||||
(write-bytes s# (.getBytes (pr-str x#) "UTF-8"))))))
|
|
||||||
|
|
||||||
(defn freeze-to-stream!
|
(defn freeze-to-stream!
|
||||||
"Low-level API. Serializes arg (any Clojure data type) to a DataOutputStream."
|
"Low-level API. Serializes arg (any Clojure data type) to a DataOutputStream."
|
||||||
|
|
@ -180,6 +176,9 @@
|
||||||
(.writeLong s (.getMostSignificantBits x))
|
(.writeLong s (.getMostSignificantBits x))
|
||||||
(.writeLong s (.getLeastSignificantBits x)))
|
(.writeLong s (.getLeastSignificantBits x)))
|
||||||
|
|
||||||
|
;; Use Clojure's own reader as final fallback
|
||||||
|
(freezer Object id-reader (write-bytes s (.getBytes (pr-str x) "UTF-8")))
|
||||||
|
|
||||||
(def ^:private head-meta-id (reduce-kv #(assoc %1 %3 %2) {} head-meta))
|
(def ^:private head-meta-id (reduce-kv #(assoc %1 %3 %2) {} head-meta))
|
||||||
|
|
||||||
(defn- wrap-header [data-ba metadata]
|
(defn- wrap-header [data-ba metadata]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue