File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -4798,13 +4798,11 @@ reduces them without incurring seq initialization"
4798
4798
(loop [sentinel lookup-sentinel
4799
4799
m m
4800
4800
ks (seq ks)]
4801
- (if ks
4802
- (if (not (satisfies? ILookup m))
4803
- not-found
4804
- (let [m (get m (first ks) sentinel)]
4805
- (if (identical? sentinel m)
4806
- not-found
4807
- (recur sentinel m (next ks)))))
4801
+ (if-not (nil? ks)
4802
+ (let [m (get m (first ks) sentinel)]
4803
+ (if (identical? sentinel m)
4804
+ not-found
4805
+ (recur sentinel m (next ks))))
4808
4806
m))))
4809
4807
4810
4808
(defn assoc-in
Original file line number Diff line number Diff line change 3210
3210
(is (zero? (hash-string nil )))
3211
3211
(is (not (zero? (hash-string " null" )))))
3212
3212
3213
+ (deftest test-cljs-1721
3214
+ (is (= 1 (get-in {:a (array 1 2 3 4 )} [:a 0 ] :not-found )))
3215
+ (is (= :not-found (get-in {:a (array 1 2 3 4 )} [:a 4 ] :not-found )))
3216
+ (is (= " d" (get-in {:a " data" } [:a 0 ] :not-found )))
3217
+ (is (= :not-found (get-in {:a " data" } [:a 4 ] :not-found ))))
3218
+
3213
3219
(comment
3214
3220
; ; ObjMap
3215
3221
; ; (let [ks (map (partial str "foo") (range 500))
You can’t perform that action at this time.
0 commit comments