optimize(radixtree_host_uri): reuse empty function. (#937)

This commit is contained in:
YuanSheng Wang 2019-12-10 13:28:40 +08:00 committed by GitHub
parent 2e7f41e503
commit 678142e051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -83,6 +83,9 @@ local function push_host_router(route, host_routes, only_uri_routes)
end
local function empty_func() end
local function create_radixtree_router(routes)
local host_routes = {}
local only_uri_routes = {}
@ -102,8 +105,7 @@ local function create_radixtree_router(routes)
filter_fun = function(vars, opts, ...)
return sub_router:dispatch(vars.uri, opts, ...)
end,
handler = function (api_ctx)
end
handler = empty_func,
})
end
if #host_router_routes > 0 then