From 8e1d649bcb80b4dd51cc74fc619141ec0e1b0bf5 Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Wed, 7 Aug 2013 17:03:55 +0700 Subject: [PATCH] Swap IPersistentCollection->ISeq (the former seems to interfere with IRecord dispatch) --- src/taoensso/nippy.clj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/taoensso/nippy.clj b/src/taoensso/nippy.clj index e8bcd92..401b4d3 100644 --- a/src/taoensso/nippy.clj +++ b/src/taoensso/nippy.clj @@ -13,7 +13,7 @@ [java.util Date UUID] [clojure.lang Keyword BigInt Ratio PersistentQueue PersistentTreeMap PersistentTreeSet IPersistentList IPersistentVector IPersistentMap - IPersistentSet IPersistentCollection IRecord])) + IPersistentMap IPersistentSet ISeq IRecord])) ;;;; Nippy 2.x+ header spec (4 bytes) (def ^:private ^:const head-version 1) @@ -45,7 +45,7 @@ (def ^:const id-vector (int 21)) ;; 22 (def ^:const id-set (int 23)) -(def ^:const id-coll (int 24)) ; Fallback: non-specific collection +(def ^:const id-seq (int 24)) (def ^:const id-meta (int 25)) (def ^:const id-queue (int 26)) (def ^:const id-map (int 27)) @@ -156,7 +156,7 @@ (coll-freezer IPersistentVector id-vector) (coll-freezer IPersistentSet id-set) (kv-freezer IPersistentMap id-map) -(coll-freezer IPersistentCollection id-coll) ; Must be LAST collection freezer! +(coll-freezer ISeq id-seq) (freezer Byte id-byte (.writeByte s x)) (freezer Short id-short (.writeShort s x)) @@ -260,7 +260,7 @@ id-vector (coll-thaw s []) id-set (coll-thaw s #{}) id-map (coll-thaw-kvs s {}) - id-coll (seq (coll-thaw s [])) + id-seq (coll-thaw s []) id-meta (let [m (thaw-from-stream s)] (with-meta (thaw-from-stream s) m))