Remove type hints that can be inferred by the compiler, part 3

This commit is contained in:
Michael S. Klishin 2012-06-09 00:36:07 +04:00
parent 5813f61649
commit 12f48b058b

View file

@ -20,7 +20,7 @@
;; Implementation ;; Implementation
;; ;;
(def ^{ :dynamic true } *query-collection*) (def ^{:dynamic true} *query-collection*)
;; ;;
;; Cursor/chain methods ;; Cursor/chain methods
@ -59,13 +59,13 @@
(merge (empty-query) { :collection coll }))) (merge (empty-query) { :collection coll })))
(defn exec (defn exec
[{ :keys [collection query fields skip limit sort batch-size hint snapshot read-preference keywordize-fields] :or { limit 0 batch-size 256 skip 0 } }] [{ :keys [^DBCollection collection query fields skip limit sort batch-size hint snapshot read-preference keywordize-fields] :or { limit 0 batch-size 256 skip 0 } }]
(let [cursor (doto ^DBCursor (.find ^DBCollection collection (to-db-object query) (as-field-selector fields)) (let [cursor (doto (.find collection (to-db-object query) (as-field-selector fields))
(.limit limit) (.limit limit)
(.skip skip) (.skip skip)
(.sort (to-db-object sort)) (.sort (to-db-object sort))
(.batchSize batch-size) (.batchSize batch-size)
(.hint ^DBObject (to-db-object hint)))] (.hint (to-db-object hint)))]
(when snapshot (when snapshot
(.snapshot cursor)) (.snapshot cursor))
(when read-preference (when read-preference