Skip to content

Commit

Permalink
Uses take-while instead of filter. It should improve running time.
Browse files Browse the repository at this point in the history
  • Loading branch information
grischoun committed Oct 9, 2020
1 parent f9953b1 commit 58f7b84
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/datahike/index/hitchhiker_tree.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
(when-let [candidates (subseq old-keys >= [a b nil nil])]
(->> candidates
(map first)
(filter #(and (= a (first %)) (= b (second %))))
(take-while #(and (= a (first %)) (= b (second %))))
reverse
first)))))

Expand Down

0 comments on commit 58f7b84

Please sign in to comment.