Skip to content

Commit

Permalink
remove unnecessary subtraction
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Mar 16, 2024
1 parent 8b31e4d commit 16ffb50
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions deps/streamsearch/sbmh.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,8 @@ SBMH.prototype._sbmh_feed = function (data) {
this.emit('info', false, this._lookbehind, 0, bytesToCutOff)
}

this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff,
this._lookbehind_size - bytesToCutOff)
this._lookbehind_size -= bytesToCutOff
this._lookbehind.copy(this._lookbehind, 0, bytesToCutOff, this._lookbehind_size)

data.copy(this._lookbehind, this._lookbehind_size)
this._lookbehind_size += len
Expand Down Expand Up @@ -212,7 +211,7 @@ SBMH.prototype._sbmh_feed = function (data) {
}

SBMH.prototype._sbmh_lookup_char = function (data, pos) {
return (pos < 0)
return pos < 0
? this._lookbehind[this._lookbehind_size + pos]
: data[pos]
}
Expand Down

0 comments on commit 16ffb50

Please sign in to comment.