From 3d134c69748e80215b2e9bc85dfd3d52c85e7257 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20Marczyk?= <michal.marczyk@gmail.com>
Date: Thu, 12 Apr 2012 14:44:15 +0200
Subject: [PATCH 2/6] Fix BitmapIndexedNode's -inode-find impl with not-found

---
 src/cljs/cljs/core.cljs |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/cljs/cljs/core.cljs b/src/cljs/cljs/core.cljs
index a3cdecf..dc3f839 100644
--- a/src/cljs/cljs/core.cljs
+++ b/src/cljs/cljs/core.cljs
@@ -2827,11 +2827,11 @@ reduces them without incurring seq initialization"
   (-inode-find [inode shift hash key not-found]
     (let [bit (bitpos hash shift)]
       (if (zero? (bit-and bitmap bit))
-        nil
+        not-found
         (let [idx         (bitmap-indexed-node-index bitmap bit)
               key-or-nil  (aget arr (* 2 idx))
               val-or-node (aget arr (inc (* 2 idx)))]
-          (cond (nil? key-or-nil)  (-inode-find val-or-node (+ shift 5) hash key)
+          (cond (nil? key-or-nil)  (-inode-find val-or-node (+ shift 5) hash key not-found)
                 (= key key-or-nil) [key-or-nil val-or-node]
                 :else not-found)))))
 
@@ -3079,7 +3079,7 @@ reduces them without incurring seq initialization"
                         nil-val
                         not-found)
           (nil? root) not-found
-          :else       (nth (-inode-find root 0 (hash k) k not-found) 1)))
+          :else       (nth (-inode-find root 0 (hash k) k (js* "([null, ~{}])" not-found)) 1)))
 
   IAssociative
   (-assoc [coll k v]
-- 
1.7.1

