From d23e6f8d8efd7106b288bf04f22f67ce7c1f5f94 Mon Sep 17 00:00:00 2001 From: Hanlei Qin Date: Wed, 19 Sep 2018 20:25:47 +0800 Subject: [PATCH] 1. remove unused code; 2. weird indents fixed. --- lualib/skynet/dns.lua | 1 - lualib/snax/hotfix.lua | 12 ++++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lualib/skynet/dns.lua b/lualib/skynet/dns.lua index fb6c2f23..c280f06a 100644 --- a/lualib/skynet/dns.lua +++ b/lualib/skynet/dns.lua @@ -372,7 +372,6 @@ local function suspend(tid, name, qtype) end end) skynet.wait(req.co) - local answers = req.answers request_pool[tid] = nil if not req.answers then local answers = lookup_cache(name, qtype, true) diff --git a/lualib/snax/hotfix.lua b/lualib/snax/hotfix.lua index a73d680e..910fbda3 100644 --- a/lualib/snax/hotfix.lua +++ b/lualib/snax/hotfix.lua @@ -71,7 +71,7 @@ local dummy_env = {} for k,v in pairs(_ENV) do dummy_env[k] = v end local function _patch(global, f) - local i = 1 + local i = 1 while true do local name, value = debug.getupvalue(f, i) if name == nil then @@ -81,10 +81,10 @@ local function _patch(global, f) if old_uv then debug.upvaluejoin(f, i, old_uv.func, old_uv.index) end - else - if type(value) == "function" then - _patch(global, value) - end + else + if type(value) == "function" then + _patch(global, value) + end end i = i + 1 end @@ -92,7 +92,7 @@ end 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)) - _patch(global, f) + _patch(global, f) desc[4] = f end