Skip to content

Commit

Permalink
perf: reuse the route table length varibale
Browse files Browse the repository at this point in the history
  • Loading branch information
xuruidong authored Sep 14, 2023
1 parent e14cbed commit d79d126
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/resty/radixtree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -577,8 +577,8 @@ function _M.new(routes, opts)
tree = tree,
tree_it = tree_it,
match_data_index = 0,
match_data = new_tab(#routes, 0),
hash_path = new_tab(0, #routes),
match_data = new_tab(route_n, 0),
hash_path = new_tab(0, route_n),
}, mt)

-- register routes
Expand Down

0 comments on commit d79d126

Please sign in to comment.