File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -9721,7 +9721,7 @@ reduces them without incurring seq initialization"
9721
9721
(let [fst (first s)
9722
9722
fv (f fst)
9723
9723
run (cons fst (take-while #(= fv (f %)) (next s)))]
9724
- (cons run (partition-by f (seq (drop (count run) s)))))))))
9724
+ (cons run (partition-by f (lazy- seq (drop (count run) s)))))))))
9725
9725
9726
9726
(defn frequencies
9727
9727
" Returns a map from distinct items in coll to the number of times
Original file line number Diff line number Diff line change 216
216
(deftest test-cljs-2482
217
217
(testing " seq on defrecord returns map entries"
218
218
(is (every? map-entry? (seq (->Foo 1 2 ))))))
219
+
220
+ (deftest test-cljs-2911
221
+ (testing " partition-by works correclty with infinite seqs"
222
+ (is (= (first (second (partition-by zero? (range )))) 1 ))))
You can’t perform that action at this time.
0 commit comments