File tree Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Expand file tree Collapse file tree 1 file changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -3503,7 +3503,6 @@ reduces them without incurring seq initialization"
35033503 :else name)]
35043504 (Keyword. ns name (str (when ns (str ns " /" )) name) nil ))))
35053505
3506-
35073506(deftype LazySeq [meta ^:mutable fn ^:mutable s ^:mutable __hash]
35083507 Object
35093508 (toString [coll]
@@ -3514,10 +3513,7 @@ reduces them without incurring seq initialization"
35143513 (if (nil? fn )
35153514 s
35163515 (do
3517- (loop [ls (fn )]
3518- (if (instance? LazySeq ls)
3519- (recur (.sval ls))
3520- (set! s (seq ls))))
3516+ (set! s (fn ))
35213517 (set! fn nil )
35223518 s)))
35233519 (indexOf [coll x]
@@ -3537,27 +3533,27 @@ reduces them without incurring seq initialization"
35373533 (-with-meta [coll new-meta]
35383534 (if (identical? new-meta meta)
35393535 coll
3540- (LazySeq. new-meta #(.sval coll) nil __hash)))
3536+ (LazySeq. new-meta #(-seq coll) nil __hash)))
35413537
35423538 IMeta
35433539 (-meta [coll] meta)
35443540
35453541 ISeq
35463542 (-first [coll]
3547- (.sval coll)
3543+ (-seq coll)
35483544 (when-not (nil? s)
3549- (- first s)))
3545+ (first s)))
35503546 (-rest [coll]
3551- (.sval coll)
3547+ (-seq coll)
35523548 (if-not (nil? s)
3553- (- rest s)
3549+ (rest s)
35543550 ()))
35553551
35563552 INext
35573553 (-next [coll]
3558- (.sval coll)
3554+ (-seq coll)
35593555 (when-not (nil? s)
3560- (- next s)))
3556+ (next s)))
35613557
35623558 ICollection
35633559 (-conj [coll o] (cons o coll))
@@ -3573,7 +3569,14 @@ reduces them without incurring seq initialization"
35733569 (-hash [coll] (caching-hash coll hash-ordered-coll __hash))
35743570
35753571 ISeqable
3576- (-seq [coll] (.sval coll))
3572+ (-seq [coll]
3573+ (.sval coll)
3574+ (when-not (nil? s)
3575+ (loop [ls s]
3576+ (if (instance? LazySeq ls)
3577+ (recur (.sval ls))
3578+ (do (set! s ls)
3579+ (seq s))))))
35773580
35783581 IReduce
35793582 (-reduce [coll f] (seq-reduce f coll))
You can’t perform that action at this time.
0 commit comments