mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-10-31 18:48:01 +00:00
Extra Lua optimizations (minimize table lookups).
This commit is contained in:
parent
8d3681dc1f
commit
90612fa98a
@ -9,10 +9,12 @@ for _, proxy in ipairs(ARGV) do
|
|||||||
for _, player in ipairs(players) do
|
for _, player in ipairs(players) do
|
||||||
local server = call("HGET", "player:" .. player, "server")
|
local server = call("HGET", "player:" .. player, "server")
|
||||||
if server then
|
if server then
|
||||||
if not serverToData[server] then
|
local map = serverToData[server]
|
||||||
|
if not map then
|
||||||
serverToData[server] = {}
|
serverToData[server] = {}
|
||||||
|
map = serverToData[server]
|
||||||
end
|
end
|
||||||
insert(serverToData[server], player)
|
insert(map, player)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user