2
0
mirror of https://github.com/proxiodev/RedisBungee.git synced 2024-11-23 04:28:01 +00:00

Extra Lua optimizations (minimize table lookups).

This commit is contained in:
Tux 2015-06-21 20:44:44 -04:00
parent 8d3681dc1f
commit 90612fa98a

View File

@ -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