From 3c8661a094e80db41e88be20bebad5c00105e062 Mon Sep 17 00:00:00 2001 From: Peter Taoussanis Date: Tue, 29 Apr 2014 22:54:13 +0700 Subject: [PATCH] [#48] Fix freeze/thaw identity on empty lazy seqs --- src/taoensso/nippy.clj | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/taoensso/nippy.clj b/src/taoensso/nippy.clj index f63492d..7d6c3e5 100644 --- a/src/taoensso/nippy.clj +++ b/src/taoensso/nippy.clj @@ -410,7 +410,9 @@ id-vector (read-coll in []) id-set (read-coll in #{}) id-map (read-kvs in {}) - id-seq (seq (read-coll in [])) + id-seq (or (seq (read-coll in [])) + (lazy-seq nil) ; Empty coll + ) id-meta (let [m (thaw-from-in in)] (with-meta (thaw-from-in in) m)) @@ -666,6 +668,7 @@ :meta (with-meta {:a :A} {:metakey :metaval}) :lazy-seq (repeatedly 1000 rand) + :lazy-seq-empty (map identity '()) :byte (byte 16) :short (short 42)