From 16ffb5041f33e7e9141a76319a4feb33eebfe313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrg=C3=BCn=20Day=C4=B1o=C4=9Flu?= Date: Sat, 16 Mar 2024 21:42:17 +0100 Subject: [PATCH] remove unnecessary subtraction --- deps/streamsearch/sbmh.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/deps/streamsearch/sbmh.js b/deps/streamsearch/sbmh.js index 79a3ff9..e96036b 100644 --- a/deps/streamsearch/sbmh.js +++ b/deps/streamsearch/sbmh.js @@ -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 @@ -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] }