Permalink
Browse files

use `into []` instead of `vec`

  • Loading branch information...
Bronsa committed Apr 11, 2014
1 parent dcc6802 commit cf7dda81a22f4c9c1fe64c699ca17e7deed61db4
@@ -449,7 +449,7 @@
{:op :letfn
:env env
:form form
- :bindings (vec (vals binds)) ;; order is irrelevant
+ :bindings (into [] (vals binds)) ;; order is irrelevant
:body body
:children [:bindings :body]})))
@@ -545,7 +545,7 @@
(-source-info form env)
(-source-info params env)))))
(let [variadic? (boolean (some '#{&} params))
- params-names (if variadic? (vec (remove '#{&} params)) params)
+ params-names (if variadic? (into [] (remove '#{&} params)) params)
env (dissoc env :local)
arity (count params-names)
params-expr (mapv (fn [name id]
@@ -47,7 +47,7 @@
(defn rseqv [v]
"Same as (comp vec rseq)"
- (vec (rseq v)))
+ (into [] (rseq v)))
(defmulti -update-children (fn [ast f] (:op ast)))
(defmulti -update-children-r (fn [ast f] (:op ast)))
@@ -22,8 +22,8 @@
(:keys meta) (:vals meta))]
(assoc meta
:form new-meta
- :keys (vec (keep first meta-map))
- :vals (vec (keep second meta-map))))))
+ :keys (into [] (keep first meta-map))
+ :vals (into [] (keep second meta-map))))))
(defn -elide-meta
[{:keys [op meta expr env] :as ast}]

3 comments on commit cf7dda8

@ghadishayban

This comment has been minimized.

Show comment
Hide comment
@ghadishayban

ghadishayban Apr 11, 2014

Member

Only bringing this up because I've done this exact thing, but this may be premature optimization. IMHO the benchmarks on CLJ-1192 and CLJ-1384 are incomplete, and I've been cautioned before about getting those right first. Wouldn't it be better to trust that #'vec impl can and will improve (possibly on top of reduce)?

Member

ghadishayban replied Apr 11, 2014

Only bringing this up because I've done this exact thing, but this may be premature optimization. IMHO the benchmarks on CLJ-1192 and CLJ-1384 are incomplete, and I've been cautioned before about getting those right first. Wouldn't it be better to trust that #'vec impl can and will improve (possibly on top of reduce)?

@Bronsa

This comment has been minimized.

Show comment
Hide comment
@Bronsa

Bronsa Apr 11, 2014

Member
Member

Bronsa replied Apr 11, 2014

@ghadishayban

This comment has been minimized.

Show comment
Hide comment
@ghadishayban

ghadishayban Apr 11, 2014

Member

👍 for measuring a real app.

Member

ghadishayban replied Apr 11, 2014

👍 for measuring a real app.

Please sign in to comment.