File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -7898,19 +7898,19 @@ reduces them without incurring seq initialization"
7898
7898
(defn set
7899
7899
" Returns a set of the distinct elements of coll."
7900
7900
[coll]
7901
- (let [^not-native in (seq coll)]
7901
+ (let [in (seq coll)]
7902
7902
(cond
7903
7903
(nil? in) #{}
7904
7904
7905
7905
(and (instance? IndexedSeq in) (zero? (.-i in)))
7906
7906
(set-from-indexed-seq in)
7907
7907
7908
7908
:else
7909
- (loop [in in
7910
- ^not-native out (-as-transient #{})]
7909
+ (loop [^not-native in in
7910
+ ^not-native out (-as-transient #{})]
7911
7911
(if-not (nil? in)
7912
- (recur (- next in) (-conj! out (-first in)))
7913
- (- persistent! out))))))
7912
+ (recur (next in) (-conj! out (-first in)))
7913
+ (persistent! out))))))
7914
7914
7915
7915
(defn hash-set
7916
7916
" Returns a new hash set with supplied keys. Any equal keys are
Original file line number Diff line number Diff line change 2779
2779
(is (= (.getBasis TypeBasis) '[a b]))
2780
2780
(is (= (.getBasis RecordBasis) '[c d e])))
2781
2781
2782
+ (deftest test-1212
2783
+ (is (= (set {:a 0 :b 0 :c 0 :d 0 :e 0 :f 0 :g 0 :h 0 :i 0 })
2784
+ #{[:a 0 ] [:b 0 ] [:c 0 ] [:d 0 ] [:e 0 ] [:f 0 ] [:g 0 ] [:h 0 ] [:i 0 ]})))
2785
+
2782
2786
(comment
2783
2787
; ; ObjMap
2784
2788
; ; (let [ks (map (partial str "foo") (range 500))
You can’t perform that action at this time.
0 commit comments