Skip to content

Commit

Permalink
perf: always check data when looking for last char of needle
Browse files Browse the repository at this point in the history
  • Loading branch information
gurgunday committed Dec 4, 2024
1 parent be7065f commit 00d234a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion deps/streamsearch/sbmh.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ SBMH.prototype._sbmh_feed = function (data) {
// or until
// the character to look at lies outside the haystack.
while (pos < 0 && pos <= len - needleLength) {
ch = this._sbmh_lookup_char(data, pos + needleLastCharIndex)
ch = data[pos + needleLastCharIndex]

if (
ch === needleLastChar &&
Expand Down

0 comments on commit 00d234a

Please sign in to comment.