Skip to content

Commit

Permalink
perf: reuse the route table length varibale (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuruidong authored Oct 7, 2023
1 parent f79bd0f commit 2f6e491
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 @@ -579,8 +579,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 2f6e491

Please sign in to comment.