From e4197daa5469d561f8b2ab293f342e9a8a1aea37 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Thu, 19 Jun 2014 16:29:54 +0800 Subject: [PATCH] minor optimize --- service/clusterd.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/service/clusterd.lua b/service/clusterd.lua index 51494971..f607e6f5 100644 --- a/service/clusterd.lua +++ b/service/clusterd.lua @@ -33,11 +33,9 @@ local node_channel = setmetatable({}, { __index = open_channel }) function command.listen(source, addr, port) local gate = skynet.newservice("gate") if port == nil then - local host, port = string.match(node_address[addr], "([^:]+):(.*)$") - skynet.call(gate, "lua", "open", { address = host, port = port }) - else - skynet.call(gate, "lua", "open", { address = addr, port = port }) + addr, port = string.match(node_address[addr], "([^:]+):(.*)$") end + skynet.call(gate, "lua", "open", { address = addr, port = port }) skynet.ret(skynet.pack(nil)) end