File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
packages/micromark-util-subtokenize/dev/lib Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import {constants} from 'micromark-util-symbol'
1010 * proportional to the number of elements added or removed, whereas
1111 * other operations (shift/unshift and splice) are much less efficient.
1212 * - Function arguments are passed on the stack, so adding tens of thousands
13- * of elements to an array with `arr.push[ ...newElements] ` will frequently
13+ * of elements to an array with `arr.push( ...newElements) ` will frequently
1414 * cause stack overflows. (see <https://stackoverflow.com/questions/22123769/rangeerror-maximum-call-stack-size-exceeded-why>)
1515 *
1616 * SpliceBuffers are an implementation of gap buffers, which are a
@@ -116,13 +116,11 @@ export class SpliceBuffer {
116116 . reverse ( )
117117 }
118118
119- const list = this . left . slice ( start )
120-
121- list . push (
122- ...this . right . slice ( this . right . length - stop + this . left . length ) . reverse ( )
123- )
124-
125- return list
119+ return this . left
120+ . slice ( start )
121+ . concat (
122+ this . right . slice ( this . right . length - stop + this . left . length ) . reverse ( )
123+ )
126124 }
127125
128126 /**
You can’t perform that action at this time.
0 commit comments