From 7cbf48bd75d12509c876bd658f98617b753fff21 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Mon, 29 May 2017 16:38:25 +1000 Subject: src/lbaselib.js: Avoid an extra copy in print --- src/lbaselib.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/lbaselib.js b/src/lbaselib.js index 5a17aa8..4ba765e 100644 --- a/src/lbaselib.js +++ b/src/lbaselib.js @@ -15,7 +15,7 @@ const luaB_print = function(L) { let s = lua.lua_tolstring(L, -1); if (s === null) return lauxlib.luaL_error(L, lua.to_luastring("'tostring' must return a string to 'print'", true)); - if (i > 1) s = ["\t".charCodeAt(0)].concat(s); + if (i > 1) str.push("\t".charCodeAt(0)); str = str.concat(s); lua.lua_pop(L, 1); } -- cgit v1.2.3-70-g09d2