mirror of
https://github.com/nodejs/node.git
synced 2026-11-09 15:11:11 -05:00
Adds the string search implementation from v8 which uses naive search if pattern length < 8 or to a specific badness then uses Boyer-Moore-Horspool Added benchmark shows the expected improvements Added option to use ucs2 encoding with Buffer::IndexOf Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trevor Norris <trev.norris@gmail.com> PR-URL: https://github.com/nodejs/node/pull/2539
11 lines
284 B
C++
11 lines
284 B
C++
#include "string_search.h"
|
|
|
|
namespace node {
|
|
namespace stringsearch {
|
|
|
|
int StringSearchBase::kBadCharShiftTable[kUC16AlphabetSize];
|
|
int StringSearchBase::kGoodSuffixShiftTable[kBMMaxShift + 1];
|
|
int StringSearchBase::kSuffixTable[kBMMaxShift + 1];
|
|
}
|
|
} // namespace node::stringsearch
|