Remove from-db-object implementation for Map
It should be enough that from-db-object is implemented for DBObject
This commit is contained in:
parent
cf3d8f2ad3
commit
1299e5e5ff
1 changed files with 0 additions and 12 deletions
|
|
@ -115,15 +115,6 @@
|
||||||
Object
|
Object
|
||||||
(from-db-object [input keywordize] input)
|
(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
|
List
|
||||||
(from-db-object [^List input keywordize]
|
(from-db-object [^List input keywordize]
|
||||||
(vec (map #(from-db-object % keywordize) input)))
|
(vec (map #(from-db-object % keywordize) input)))
|
||||||
|
|
@ -141,9 +132,6 @@
|
||||||
;; DBObject provides .toMap, but the implementation in
|
;; DBObject provides .toMap, but the implementation in
|
||||||
;; subclass GridFSFile unhelpfully throws
|
;; subclass GridFSFile unhelpfully throws
|
||||||
;; UnsupportedOperationException.
|
;; 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
|
(reduce (if keywordize
|
||||||
(fn [m ^String k]
|
(fn [m ^String k]
|
||||||
(assoc m (keyword k) (from-db-object (.get input k) true)))
|
(assoc m (keyword k) (from-db-object (.get input k) true)))
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue