                                                   extra-resolvers))
                                               (set route-params)
                                               arglist)
-
-                           middleware (get middleware middleware-key)
 
                            ;; middleware may return nil, so:
 

           entries (seq (unnest-dispatch-table dispatch-table))]
      (if-let [analyze-state' (analyze* analyze-state arg-resolvers (first entries))]
        (recur analyze-state' (next entries))
        (let [[routes handlers middleware] analyze-state]
          {:routes     (sorted-routes routes)
           :handlers   handlers
           :middleware (set/map-invert middleware)})))))

(defn- map-traversal-dispatcher
  "Returns a Ring handler using the given dispatch-map to guide


(defn- build-dispatch-map
  "Returns a dispatch-map for use with map-traversal-dispatcher."
  [{:keys [routes handlers]}
   {:keys [async? arg-resolvers sync-wrapper]}]
  (reduce (fn [dispatch-map [[method pathvec] handler-key]]
            (t/track #(format "Compiling handler for `%s'."
                              (get-in handlers [handler-key :verb-fn-sym]))
                     (let [{:keys           [middleware route-params
                                             verb-fn-sym arglist
                                             metadata context]
                            extra-resolvers :arg-resolvers}
