From 5f1d6a61a6896c9420b95071e1cf9bbdd9631dc7 Mon Sep 17 00:00:00 2001 From: Tommi Reiman Date: Sat, 12 Aug 2017 17:55:58 +0300 Subject: [PATCH] Cleanup & fix perf test --- perf-test/clj/reitit/perf_test.clj | 2 +- src/reitit/core.cljc | 4 ++-- src/reitit/impl.cljc | 2 +- test/cljc/reitit/core_test.cljc | 1 - 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/perf-test/clj/reitit/perf_test.clj b/perf-test/clj/reitit/perf_test.clj index 0ae01ce1..abf917ab 100644 --- a/perf-test/clj/reitit/perf_test.clj +++ b/perf-test/clj/reitit/perf_test.clj @@ -93,7 +93,7 @@ ;; 2.4µs (-84%) (title "pedestal - map-tree => prefix-tree") - (let [call #(pedestal/find-route pedestal-routes {:path-info "/workspace/1/1" :request-method :get})] + (let [call #(pedestal/find-route pedestal-router {:path-info "/workspace/1/1" :request-method :get})] (assert (call)) (cc/quick-bench (call))) diff --git a/src/reitit/core.cljc b/src/reitit/core.cljc index 9f8e39f1..0cf00bbd 100644 --- a/src/reitit/core.cljc +++ b/src/reitit/core.cljc @@ -90,7 +90,7 @@ "Creates a [[LinearRouter]] from routes and optional options. See [[router]] for available options" ([routes] - (linear-router routes {})) + (linear-router routes {})) ([routes {:keys [compile]}] (let [compiled (map (partial compile-route compile) routes)] (->LinearRouter @@ -118,7 +118,7 @@ "Creates a [[LookupRouter]] from routes and optional options. See [[router]] for available options" ([routes] - (lookup-router routes {})) + (lookup-router routes {})) ([routes {:keys [compile]}] (let [compiled (map (partial compile-route compile) routes)] (when-let [route (some impl/contains-wilds? (map first routes))] diff --git a/src/reitit/impl.cljc b/src/reitit/impl.cljc index fad07a33..38fb5577 100644 --- a/src/reitit/impl.cljc +++ b/src/reitit/impl.cljc @@ -10,7 +10,7 @@ ; ; You must not remove this notice, or any other, from this software. -(ns reitit.impl +(ns ^:no-doc reitit.impl (:require [clojure.string :as str] [clojure.set :as set]) (:import #?(:clj (java.util.regex Pattern)))) diff --git a/test/cljc/reitit/core_test.cljc b/test/cljc/reitit/core_test.cljc index 738a5d7c..deeb9e4d 100644 --- a/test/cljc/reitit/core_test.cljc +++ b/test/cljc/reitit/core_test.cljc @@ -119,4 +119,3 @@ :path "/api/user/1/2" :params {:id "1", :sub-id "2"}}) (reitit/match-by-path router "/api/user/1/2")))))) -