mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 12:43:09 +00:00
1. remove unused code; 2. weird indents fixed.
This commit is contained in:
@@ -372,7 +372,6 @@ local function suspend(tid, name, qtype)
|
|||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
skynet.wait(req.co)
|
skynet.wait(req.co)
|
||||||
local answers = req.answers
|
|
||||||
request_pool[tid] = nil
|
request_pool[tid] = nil
|
||||||
if not req.answers then
|
if not req.answers then
|
||||||
local answers = lookup_cache(name, qtype, true)
|
local answers = lookup_cache(name, qtype, true)
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ local dummy_env = {}
|
|||||||
for k,v in pairs(_ENV) do dummy_env[k] = v end
|
for k,v in pairs(_ENV) do dummy_env[k] = v end
|
||||||
|
|
||||||
local function _patch(global, f)
|
local function _patch(global, f)
|
||||||
local i = 1
|
local i = 1
|
||||||
while true do
|
while true do
|
||||||
local name, value = debug.getupvalue(f, i)
|
local name, value = debug.getupvalue(f, i)
|
||||||
if name == nil then
|
if name == nil then
|
||||||
@@ -81,10 +81,10 @@ local function _patch(global, f)
|
|||||||
if old_uv then
|
if old_uv then
|
||||||
debug.upvaluejoin(f, i, old_uv.func, old_uv.index)
|
debug.upvaluejoin(f, i, old_uv.func, old_uv.index)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if type(value) == "function" then
|
if type(value) == "function" then
|
||||||
_patch(global, value)
|
_patch(global, value)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end
|
end
|
||||||
@@ -92,7 +92,7 @@ end
|
|||||||
|
|
||||||
local function patch_func(funcs, global, group, name, f)
|
local function patch_func(funcs, global, group, name, f)
|
||||||
local desc = assert(find_func(funcs, group, name) , string.format("Patch mismatch %s.%s", group, name))
|
local desc = assert(find_func(funcs, group, name) , string.format("Patch mismatch %s.%s", group, name))
|
||||||
_patch(global, f)
|
_patch(global, f)
|
||||||
desc[4] = f
|
desc[4] = f
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user