summaryrefslogtreecommitdiff
path: root/src/lobject.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/lobject.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/lobject.js')
-rw-r--r--src/lobject.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lobject.js b/src/lobject.js
index 18adb27..5ca7cd3 100644
--- a/src/lobject.js
+++ b/src/lobject.js
@@ -531,7 +531,7 @@ const luaO_pushvfstring = function(L, fmt, argp) {
for (;;) {
e = fmt.indexOf(char['%'], i);
if (e == -1) break;
- pushstr(L, fmt.slice(i, e));
+ pushstr(L, fmt.subarray(i, e));
switch(fmt[e+1]) {
case char['s']: {
let s = argp[a++];
@@ -540,7 +540,7 @@ const luaO_pushvfstring = function(L, fmt, argp) {
/* respect null terminator */
let i = s.indexOf(0);
if (i !== -1)
- s = s.slice(0, i);
+ s = s.subarray(0, i);
}
pushstr(L, s);
break;
@@ -609,7 +609,7 @@ const luaO_pushvfstring = function(L, fmt, argp) {
i = e + 2;
}
ldo.luaD_checkstack(L, 1);
- pushstr(L, fmt.slice(i));
+ pushstr(L, fmt.subarray(i));
if (n > 0) lvm.luaV_concat(L, n+1);
return L.stack[L.top-1].svalue();
};