From ceeac554967dfe7a3bf5798fe1aca75128956d75 Mon Sep 17 00:00:00 2001 From: "Michael S. Klishin" Date: Thu, 12 Apr 2012 17:12:08 +0400 Subject: [PATCH] A more efficient implementation of clojure.core.cache/has? for BasicMongerCache --- src/monger/cache.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/monger/cache.clj b/src/monger/cache.clj index 3989b68..432c440 100644 --- a/src/monger/cache.clj +++ b/src/monger/cache.clj @@ -28,7 +28,7 @@ (:value doc) not-found)) (has? [c k] - (mc/any? (get c :collection) {:_id k})) + (not (nil? (mc/find-by-id (get c :collection) k)))) (hit [this k] this) (miss [c k v]