Skip to content

Commit 3104e1e

Browse files
authored
change: code style. (#22)
1 parent 608706a commit 3104e1e

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/resty/radixtree.lua

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-- Copyright (C) Yuansheng Wang
2+
23
local ipmatcher = require("resty.ipmatcher")
34
local base = require("resty.core.base")
45
local clear_tab = require("table.clear")
@@ -7,7 +8,7 @@ local bit = require("bit")
78
local new_tab = base.new_tab
89
local tonumber = tonumber
910
local ipairs = ipairs
10-
local ffi = require "ffi"
11+
local ffi = require("ffi")
1112
local ffi_cast = ffi.cast
1213
local ffi_cdef = ffi.cdef
1314
local insert_tab = table.insert
@@ -21,7 +22,7 @@ local error = error
2122
local newproxy = newproxy
2223
local tostring = tostring
2324
local cur_level = ngx.config.subsystem == "http" and
24-
require "ngx.errlog" .get_sys_filter_level()
25+
require("ngx.errlog").get_sys_filter_level()
2526
local ngx_var = ngx.var
2627

2728

@@ -179,10 +180,11 @@ local function parse_remote_addr(route_remote_addrs)
179180
end
180181

181182

183+
local pre_insert_route
182184
do
183185
local route_opts = {}
184186

185-
local function pre_insert_route(self, path, route)
187+
function pre_insert_route(self, path, route)
186188
if type(path) ~= "string" then
187189
error("invalid argument path", 2)
188190
end
@@ -288,6 +290,9 @@ local function pre_insert_route(self, path, route)
288290
insert_route(self, route_opts)
289291
end
290292

293+
end -- do
294+
295+
291296
function _M.new(routes)
292297
if not routes then
293298
return nil, "missing argument route"
@@ -326,8 +331,6 @@ function _M.new(routes)
326331
return self
327332
end
328333

329-
end -- do
330-
331334

332335
function _M.free(self)
333336
local it = self.tree_it

0 commit comments

Comments
 (0)