« get me outta code hell

simplify once-used pushNode call (cur: 48.5k/sec) - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <towerofnix@gmail.com>2021-04-15 13:20:23 -0300
committer(quasar) nebula <towerofnix@gmail.com>2021-04-15 13:21:15 -0300
commit5eb59b15d7edbdeeb366b9ee248ae1045a326d8a (patch)
tree7e0d67e9930332f6e5cc9ecfff043472a6306a00
parent802b1ed64b729f95b77d48f9f024141e95d296a5 (diff)
simplify once-used pushNode call (cur: 48.5k/sec)
The idea here is to get rid of unnecessary destructuring of the
arguments array.
-rwxr-xr-xupd8.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/upd8.js b/upd8.js
index 7b66215e..b610fa8b 100755
--- a/upd8.js
+++ b/upd8.js
@@ -1015,10 +1015,9 @@ const replacerSpec = {
         let string = '';
         let iString = 0;
 
-        const pushNode = (...args) => nodes.push(makeNode(...args));
         const pushTextNode = () => {
             if (string.length) {
-                pushNode(iString, 'text', {string});
+                nodes.push(makeNode(iString, 'text', {string}));
                 string = '';
             }
         };