Skip to content

Commit 2f6e491

Browse files
authored
perf: reuse the route table length varibale (#137)
1 parent f79bd0f commit 2f6e491

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/resty/radixtree.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,8 +579,8 @@ function _M.new(routes, opts)
579579
tree = tree,
580580
tree_it = tree_it,
581581
match_data_index = 0,
582-
match_data = new_tab(#routes, 0),
583-
hash_path = new_tab(0, #routes),
582+
match_data = new_tab(route_n, 0),
583+
hash_path = new_tab(0, route_n),
584584
}, mt)
585585

586586
-- register routes

0 commit comments

Comments
 (0)