From 1299e5e5ff777ebd807c6afb103f2cd47f97bfc7 Mon Sep 17 00:00:00 2001 From: Juho Teperi Date: Fri, 9 Oct 2015 00:35:02 +0300 Subject: [PATCH] Remove from-db-object implementation for Map It should be enough that from-db-object is implemented for DBObject --- src/clojure/monger/conversion.clj | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/clojure/monger/conversion.clj b/src/clojure/monger/conversion.clj index 3d6f6f9..8ed2c5f 100644 --- a/src/clojure/monger/conversion.clj +++ b/src/clojure/monger/conversion.clj @@ -115,15 +115,6 @@ Object (from-db-object [input keywordize] input) - Map - (from-db-object [^Map input keywordize] - (reduce (if keywordize - (fn [m ^String k] - (assoc m (keyword k) (from-db-object (.get input k) true))) - (fn [m ^String k] - (assoc m k (from-db-object (.get input k) false)))) - {} (.keySet input))) - List (from-db-object [^List input keywordize] (vec (map #(from-db-object % keywordize) input))) @@ -141,9 +132,6 @@ ;; DBObject provides .toMap, but the implementation in ;; subclass GridFSFile unhelpfully throws ;; UnsupportedOperationException. - ;; This is the same code as with Map. The code can't be shared using a - ;; function because reflection would kill the performance and DBObject - ;; and Map don't share a interface. (reduce (if keywordize (fn [m ^String k] (assoc m (keyword k) (from-db-object (.get input k) true)))