aboutsummaryrefslogtreecommitdiff
path: root/src/lauxlib.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-12-13 14:56:26 +1100
committerdaurnimator <quae@daurnimator.com>2017-12-13 15:31:07 +1100
commit17e4cff6514c75920462397c227408c21336d1ae (patch)
tree2a3768d78a30f77adbc52231ac61909e64794a48 /src/lauxlib.js
parent11a2421acaf2b39d19ee99933102c35e28fd13f8 (diff)
downloadfengari-17e4cff6514c75920462397c227408c21336d1ae.tar.gz
fengari-17e4cff6514c75920462397c227408c21336d1ae.tar.bz2
fengari-17e4cff6514c75920462397c227408c21336d1ae.zip
src/: Use .subarray instead of .slice (optimisation)
Diffstat (limited to 'src/lauxlib.js')
-rw-r--r--src/lauxlib.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lauxlib.js b/src/lauxlib.js
index 6acf57f..3b2be6e 100644
--- a/src/lauxlib.js
+++ b/src/lauxlib.js
@@ -62,7 +62,7 @@ const pushglobalfuncname = function(L, ar) {
if (findfield(L, top + 1, 2)) {
let name = lua.lua_tostring(L, -1);
if (name[0] === "_".charCodeAt(0) && name[1] === "G".charCodeAt(0) && name[2] === ".".charCodeAt(0)) { /* name start with '_G.'? */
- lua.lua_pushstring(L, name.slice(3)); /* push name without prefix */
+ lua.lua_pushstring(L, name.subarray(3)); /* push name without prefix */
lua.lua_remove(L, -2); /* remove original name */
}
lua.lua_copy(L, -1, top + 1); /* move name to proper place */