          (if-let [match (impl/fast-get lookup name)]
            (match (impl/path-params path-params))))))))
 
+(defn- lookup-router-lookup-structs
+  "Returns a 2-item vec of lookup structures.
+
+  The first is a map of paths to Matches.
+  The second is a map of route names to Matches."
+  [compiled-routes]
+  (reduce
+    (fn [[pl nl] [p {:keys [name] :as data} result]]
+      [(assoc pl p (->Match p data result {} p))
+       (if name
+         (assoc nl name #(->Match p data result % p))
+         nl)])
+    [{} {}]
+    compiled-routes))
+
 (defn lookup-router
   "Creates a lookup-router from resolved routes and optional
   expanded options. See [[router]] for available options"

   :compile (fn [[_ {:keys [handler]}] _] handler)
   :conflicts (partial throw-on-conflicts! path-conflicts-str)})

(defn linear-router
  "Creates a linear-router from resolved routes and optional
  expanded options. See [[router]] for available options"

   (segment-router compiled-routes {}))
  ([compiled-routes opts]
   (let [names (find-names compiled-routes opts)
         [pl nl] (segment-router-lookup-structs compiled-routes)
         lookup (impl/fast-map nl)
         routes (uncompile-routes compiled-routes)]
     ^{:type ::router}
