File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -99,13 +99,14 @@ export class Decoder<ContextType = undefined> {
9999 if ( this . headByte === HEAD_BYTE_REQUIRED && ! this . hasRemaining ( ) ) {
100100 this . setBuffer ( buffer ) ;
101101 } else {
102- // retried because data is insufficient
103102 const remainingData = this . bytes . subarray ( this . pos ) ;
104103 const newData = ensureUint8Array ( buffer ) ;
105- const concated = new Uint8Array ( remainingData . length + newData . length ) ;
106- concated . set ( remainingData ) ;
107- concated . set ( newData , remainingData . length ) ;
108- this . setBuffer ( concated ) ;
104+
105+ // concat remainingData + newData
106+ const newBuffer = new Uint8Array ( remainingData . length + newData . length ) ;
107+ newBuffer . set ( remainingData ) ;
108+ newBuffer . set ( newData , remainingData . length ) ;
109+ this . setBuffer ( newBuffer ) ;
109110 }
110111 }
111112
You can’t perform that action at this time.
0 commit comments