File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -5524,9 +5524,10 @@ reduces them without incurring seq initialization"
55245524
55255525 IFind
55265526 (-find [coll n]
5527- (when (and (not (neg? n))
5528- (< (+ start n) end))
5529- (-find v (+ start n))))
5527+ (when-not (neg? n)
5528+ (let [idx (+ start n)]
5529+ (when (< idx end)
5530+ [n (-lookup v idx)]))))
55305531
55315532 IVector
55325533 (-assoc-n [coll n val]
Original file line number Diff line number Diff line change 9999 (testing " rseq equality"
100100 (is (= (rseq sv1) '(1 )))
101101 (is (nil? (rseq sv2)))))
102- (let [s (subvec [0 1 2 3 ] 0 2 )]
102+ (let [sv1 (subvec [0 1 2 3 ] 0 2 )
103+ sv2 (subvec [0 1 2 3 ] 1 3 )]
103104 (testing " IFind"
104- (is (= (find s 0 ) [0 0 ]))
105- (is (= (find s 1 ) [1 1 ]))
106- (is (= (find s 2 ) nil ))
107- (is (= (find s -1 ) nil ))))
105+ (is (= (find sv1 0 ) [0 0 ]))
106+ (is (= (find sv1 1 ) [1 1 ]))
107+ (is (= (find sv1 2 ) nil ))
108+ (is (= (find sv1 -1 ) nil ))
109+ (is (= (find sv2 0 ) [0 1 ]))
110+ (is (= (find sv2 1 ) [1 2 ]))
111+ (is (= (find sv2 2 ) nil ))
112+ (is (= (find sv2 -1 ) nil ))))
108113 )
109114 ))
110115
You can’t perform that action at this time.
0 commit comments