summaryrefslogtreecommitdiff
path: root/src/llex.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/llex.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/llex.js')
-rw-r--r--src/llex.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/llex.js b/src/llex.js
index 9e4bed4..438f288 100644
--- a/src/llex.js
+++ b/src/llex.js
@@ -328,7 +328,7 @@ const read_long_string = function(ls, seminfo, sep) {
}
if (seminfo)
- seminfo.ts = luaX_newstring(ls, ls.buff.buffer.slice(2 + sep, ls.buff.n - (2 + sep)));
+ seminfo.ts = luaX_newstring(ls, ls.buff.buffer.subarray(2 + sep, ls.buff.n - (2 + sep)));
};
const esccheck = function(ls, c, msg) {
@@ -453,7 +453,7 @@ const read_string = function(ls, del, seminfo) {
}
save_and_next(ls); /* skip delimiter */
- seminfo.ts = luaX_newstring(ls, ls.buff.buffer.slice(1, ls.buff.n-1));
+ seminfo.ts = luaX_newstring(ls, ls.buff.buffer.subarray(1, ls.buff.n-1));
};
const token_to_index = Object.create(null); /* don't want to return true for e.g. 'hasOwnProperty' */