From 24e8b0ac1ea45719937948607259f13866c8bc64 Mon Sep 17 00:00:00 2001 From: Rui914 Date: Mon, 7 Mar 2016 00:53:45 +0900 Subject: Faster insertion into table --- builtin/mainmenu/common.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin/mainmenu/common.lua') diff --git a/builtin/mainmenu/common.lua b/builtin/mainmenu/common.lua index f4020aaaf..f40c787a2 100644 --- a/builtin/mainmenu/common.lua +++ b/builtin/mainmenu/common.lua @@ -67,13 +67,13 @@ function order_favorite_list(list) for i=1,#list,1 do local fav = list[i] if is_server_protocol_compat(fav.proto_min, fav.proto_max) then - table.insert(res, fav) + res[#res + 1] = fav end end for i=1,#list,1 do local fav = list[i] if not is_server_protocol_compat(fav.proto_min, fav.proto_max) then - table.insert(res, fav) + res[#res + 1] = fav end end return res -- cgit v1.2.3