mirror of
https://github.com/metosin/reitit.git
synced 2025-12-16 16:01:11 +00:00
Finalize Trie & cleanup
This commit is contained in:
parent
a44267ba85
commit
59560860d8
3 changed files with 5 additions and 24 deletions
|
|
@ -40,7 +40,7 @@ public class Trie {
|
|||
|
||||
public static class Match {
|
||||
public IPersistentMap params;
|
||||
public Object data;
|
||||
public final Object data;
|
||||
|
||||
public Match(IPersistentMap params, Object data) {
|
||||
this.params = params;
|
||||
|
|
@ -68,7 +68,7 @@ public class Trie {
|
|||
return new StaticMatcher(path, child);
|
||||
}
|
||||
|
||||
static class StaticMatcher implements Matcher {
|
||||
static final class StaticMatcher implements Matcher {
|
||||
private final Matcher child;
|
||||
private final char[] path;
|
||||
private final int size;
|
||||
|
|
@ -238,7 +238,6 @@ public class Trie {
|
|||
}
|
||||
|
||||
static final class LinearMatcher implements Matcher {
|
||||
|
||||
private final Matcher[] childs;
|
||||
private final int size;
|
||||
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
(recur ss from (inc to))
|
||||
(recur (concat ss (-static from to) (-wild to to')) (long to') (long to'))))
|
||||
\* (let [to' (count s)]
|
||||
(recur (concat ss (-static from to) (-catch-all to to')) to' to'))
|
||||
(recur (concat ss (-static from to) (-catch-all to to')) (long to') (long to')))
|
||||
(recur ss from (inc to)))))))
|
||||
|
||||
(defn join-path [xs]
|
||||
|
|
@ -405,21 +405,4 @@
|
|||
["/v1/orgs/:org-id/topics" 57]]
|
||||
(insert)
|
||||
(compile)
|
||||
(pretty)
|
||||
(./aprint))
|
||||
|
||||
(-> [["/{a}/2"]
|
||||
["/{a}.2"]]
|
||||
(insert)
|
||||
(compile))
|
||||
|
||||
(-> [["/kikka" 2]
|
||||
["/kikka/kakka/kukka" 3]
|
||||
["/kikka/:kakka/kurkku" 4]
|
||||
["/kikka/kuri/{user/doc}/html" 5]]
|
||||
(insert)
|
||||
(compile)
|
||||
(pretty))
|
||||
|
||||
(map str (.toCharArray "\u2215\u0048\u0065\u006C\u006C\u006F"))
|
||||
(count ["∕" "H" "e" "l" "l" "o" " " "W" "o" "r" "l" "d"]))
|
||||
(pretty)))
|
||||
|
|
|
|||
|
|
@ -15,8 +15,7 @@
|
|||
[io.pedestal.http.route.map-tree :as map-tree]
|
||||
[io.pedestal.http.route.router :as pedestal]
|
||||
[reitit.core :as r]
|
||||
[criterium.core :as cc]
|
||||
[reitit.trie :as trie]))
|
||||
[criterium.core :as cc]))
|
||||
|
||||
;;
|
||||
;; start repl with `lein perf repl`
|
||||
|
|
|
|||
Loading…
Reference in a new issue