# HG changeset patch # User jbe # Date 1500774229 -7200 # Node ID e360b1933c78babff0348f1939d564ae990cdc4a # Parent d89813dd4d922f537520ba46917acf41e37b69e9 Improve efficiency of table.insert in case of Lua 5.3 (do not use compatibility wrapper) diff -r d89813dd4d92 -r e360b1933c78 framework/env/__init.lua --- a/framework/env/__init.lua Sun Jul 23 02:51:13 2017 +0200 +++ b/framework/env/__init.lua Sun Jul 23 03:43:49 2017 +0200 @@ -64,10 +64,10 @@ Custom implementation of Lua's table.insert(...) where table.insert(table, value) also respects metamethods in Lua 5.2 (this behavior is already supported by Lua 5.3). --]]-- -do +if _VERSION == "Lua 5.2" then local old_insert = table.insert function table.insert(...) - if _VERSION == "Lua 5.2" and select("#", ...) == 2 then + if select("#", ...) == 2 then local t, value = ... t[#t+1] = value return