Permalink
Browse files

loop removal courtesy of pyr

Signed-off-by: Chris Granger <ibdknox@gmail.com>
  • Loading branch information...
ibdknox committed Aug 11, 2011
1 parent 5a06898 commit 886fc0baf47c79912347911966c0873feadc3d4f
Showing with 3 additions and 7 deletions.
  1. +3 −7 src/noir/server.clj
View
@@ -26,13 +26,9 @@
handler))
(defn- wrap-custom-middleware [handler]
- (loop [cur handler
- mware (seq @middleware)]
- (if-not mware
- cur
- (let [[func args] (first mware)
- neue (apply func cur args)]
- (recur neue (next mware))))))
+ (reduce (fn [cur [func args]] (apply func cur args))
+ handler
+ (seq @middleware)))
(defn- pack-routes []
(apply routes (concat (vals @noir/pre-routes) (vals @noir/noir-routes) noir/spec-routes)))

0 comments on commit 886fc0b

Please sign in to comment.