@@ -50,9 +50,9 @@ BufferList.prototype._offset = function _offset (offset) {
5050}
5151
5252BufferList . prototype . _reverseOffset = function ( blOffset ) {
53- const bufferId = blOffset [ 0 ]
54- let offset = blOffset [ 1 ]
55- for ( let i = 0 ; i < bufferId ; i ++ ) {
53+ var bufferId = blOffset [ 0 ]
54+ var offset = blOffset [ 1 ]
55+ for ( var i = 0 ; i < bufferId ; i ++ ) {
5656 offset += this . _bufs [ i ] . length
5757 }
5858 return offset
@@ -121,7 +121,7 @@ BufferList.prototype.get = function get (index) {
121121 if ( index > this . length || index < 0 ) {
122122 return undefined
123123 }
124- const offset = this . _offset ( index )
124+ var offset = this . _offset ( index )
125125 return this . _bufs [ offset [ 0 ] ] [ offset [ 1 ] ]
126126}
127127
@@ -297,23 +297,23 @@ BufferList.prototype.indexOf = function (search, offset, encoding) {
297297 return offset > this . length ? this . length : offset
298298 }
299299
300- const blOffset = this . _offset ( offset )
301- let blIndex = blOffset [ 0 ] // index of which internal buffer we're working on
302- let buffOffset = blOffset [ 1 ] // offset of the internal buffer we're working on
300+ var blOffset = this . _offset ( offset )
301+ var blIndex = blOffset [ 0 ] // index of which internal buffer we're working on
302+ var buffOffset = blOffset [ 1 ] // offset of the internal buffer we're working on
303303
304304 // scan over each buffer
305305 for ( blIndex ; blIndex < this . _bufs . length ; blIndex ++ ) {
306- const buff = this . _bufs [ blIndex ]
306+ var buff = this . _bufs [ blIndex ]
307307 while ( buffOffset < buff . length ) {
308- const availableWindow = buff . length - buffOffset
308+ var availableWindow = buff . length - buffOffset
309309 if ( availableWindow >= search . length ) {
310- const nativeSearchResult = buff . indexOf ( search , buffOffset )
310+ var nativeSearchResult = buff . indexOf ( search , buffOffset )
311311 if ( nativeSearchResult !== - 1 ) {
312312 return this . _reverseOffset ( [ blIndex , nativeSearchResult ] )
313313 }
314314 buffOffset = buff . length - search . length + 1 // end of native search window
315315 } else {
316- const revOffset = this . _reverseOffset ( [ blIndex , buffOffset ] )
316+ var revOffset = this . _reverseOffset ( [ blIndex , buffOffset ] )
317317 if ( this . _match ( revOffset , search ) ) {
318318 return revOffset
319319 }
@@ -329,7 +329,7 @@ BufferList.prototype._match = function(offset, search) {
329329 if ( this . length - offset < search . length ) {
330330 return false
331331 }
332- for ( let searchOffset = 0 ; searchOffset < search . length ; searchOffset ++ ) {
332+ for ( var searchOffset = 0 ; searchOffset < search . length ; searchOffset ++ ) {
333333 if ( this . get ( offset + searchOffset ) !== search [ searchOffset ] ) {
334334 return false
335335 }
0 commit comments