Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

* src/cljs/cljs/core.cljs: move bounded count into local in apply

  • Loading branch information...
commit 36d4e99932965d11eec5d2bcee124c70c21c6565 1 parent ce8e5d1
David Nolen authored
Showing with 20 additions and 15 deletions.
  1. +20 −15 src/cljs/cljs/core.cljs
View
35 src/cljs/cljs/core.cljs
@@ -1748,41 +1748,46 @@ reduces them without incurring seq initialization"
([f args]
(let [fixed-arity (.-cljs$lang$maxFixedArity f)]
(if (.-cljs$lang$applyTo f)
- (if (<= (bounded-count args (inc fixed-arity)) fixed-arity)
- (.apply f f (to-array args))
- (.cljs$lang$applyTo f args))
+ (let [bc (bounded-count args (inc fixed-arity))]
+ (if (<= bc fixed-arity)
+ (.apply f f (to-array args))
+ (.cljs$lang$applyTo f args)))
(.apply f f (to-array args)))))
([f x args]
(let [arglist (list* x args)
fixed-arity (.-cljs$lang$maxFixedArity f)]
(if (.-cljs$lang$applyTo f)
- (if (<= (bounded-count arglist (inc fixed-arity)) fixed-arity)
- (.apply f f (to-array arglist))
- (.cljs$lang$applyTo f arglist))
+ (let [bc (bounded-count arglist (inc fixed-arity))]
+ (if (<= bc fixed-arity)
+ (.apply f f (to-array arglist))
+ (.cljs$lang$applyTo f arglist)))
(.apply f f (to-array arglist)))))
([f x y args]
(let [arglist (list* x y args)
fixed-arity (.-cljs$lang$maxFixedArity f)]
(if (.-cljs$lang$applyTo f)
- (if (<= (bounded-count arglist (inc fixed-arity)) fixed-arity)
- (.apply f f (to-array arglist))
- (.cljs$lang$applyTo f arglist))
+ (let [bc (bounded-count arglist (inc fixed-arity))]
+ (if (<= bc fixed-arity)
+ (.apply f f (to-array arglist))
+ (.cljs$lang$applyTo f arglist)))
(.apply f f (to-array arglist)))))
([f x y z args]
(let [arglist (list* x y z args)
fixed-arity (.-cljs$lang$maxFixedArity f)]
(if (.-cljs$lang$applyTo f)
- (if (<= (bounded-count arglist (inc fixed-arity)) fixed-arity)
- (.apply f f (to-array arglist))
- (.cljs$lang$applyTo f arglist))
+ (let [bc (bounded-count arglist (inc fixed-arity))]
+ (if (<= bc fixed-arity)
+ (.apply f f (to-array arglist))
+ (.cljs$lang$applyTo f arglist)))
(.apply f f (to-array arglist)))))
([f a b c d & args]
(let [arglist (cons a (cons b (cons c (cons d (spread args)))))
fixed-arity (.-cljs$lang$maxFixedArity f)]
(if (.-cljs$lang$applyTo f)
- (if (<= (bounded-count arglist (inc fixed-arity)) fixed-arity)
- (.apply f f (to-array arglist))
- (.cljs$lang$applyTo f arglist))
+ (let [bc (bounded-count arglist (inc fixed-arity))]
+ (if (<= bc fixed-arity)
+ (.apply f f (to-array arglist))
+ (.cljs$lang$applyTo f arglist)))
(.apply f f (to-array arglist))))))
(defn vary-meta
Please sign in to comment.
Something went wrong with that request. Please try again.