Skip to content

Commit

Permalink
chore: add some new file and update some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Oct 24, 2022
1 parent dbe6770 commit f5ed9e0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion _benchmarks/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module bench
module ruxbench

go 1.12

Expand Down
4 changes: 4 additions & 0 deletions adaptor/fasthttp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# FastRux

base on fasthttp

Empty file added adaptor/gohttp/.keep
Empty file.
6 changes: 3 additions & 3 deletions parse_match.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func (r *Router) QuickMatch(method, path string) (route *Route, ps Params, alm [

func (r *Router) match(method, path string) (rt *Route, ps Params) {
// find in stable routes
if route, ok := r.stableRoutes[method + path]; ok {
if route, ok := r.stableRoutes[method+path]; ok {
// return r.newMatchResult(route, nil)
return route, nil
}
Expand All @@ -163,7 +163,7 @@ func (r *Router) match(method, path string) (rt *Route, ps Params) {
key := method + path[1:pos+1]

if rs, ok := r.regularRoutes[key]; ok {
for i,_ := range rs {
for i := range rs {
if strings.Index(path, rs[i].start) != 0 {
continue
}
Expand All @@ -181,7 +181,7 @@ func (r *Router) match(method, path string) (rt *Route, ps Params) {
if rs, ok := r.irregularRoutes[method]; ok {
for _, route := range rs {
if ps, ok := route.matchRegex(path); ok {
r.cacheDynamicRoute(method + path, ps, route)
r.cacheDynamicRoute(method+path, ps, route)
return route, ps
}
}
Expand Down

0 comments on commit f5ed9e0

Please sign in to comment.