Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

loop removal courtesy of pyr

Signed-off-by: Chris Granger <ibdknox@gmail.com>
  • Loading branch information...
commit 886fc0baf47c79912347911966c0873feadc3d4f 1 parent 5a06898
@ibdknox ibdknox authored
Showing with 3 additions and 7 deletions.
  1. +3 −7 src/noir/server.clj
View
10 src/noir/server.clj
@@ -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)))
Please sign in to comment.
Something went wrong with that request. Please try again.