mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-21 04:44:40 +02:00
Fix boost REGEX performance issue
This commit revert 86c66bba90cc3f49323cdcae77173099122c75dc due to the boost REGEX performance issue. Fix #10398, fix #10296, fix #10260, close #10403
This commit is contained in:
parent
8f123f8cca
commit
6844df039d
@ -417,9 +417,7 @@ void BoostRegexSearch::EncodingDependent<CharT, CharacterIterator>::compileRegex
|
|||||||
{
|
{
|
||||||
if (_lastCompileFlags != compileFlags || _lastRegexString != regex)
|
if (_lastCompileFlags != compileFlags || _lastRegexString != regex)
|
||||||
{
|
{
|
||||||
std::locale l = std::locale::global(std::locale(""));
|
|
||||||
_regex = Regex(CharTPtr(regex), static_cast<regex_constants::syntax_option_type>(compileFlags));
|
_regex = Regex(CharTPtr(regex), static_cast<regex_constants::syntax_option_type>(compileFlags));
|
||||||
std::locale::global(l);
|
|
||||||
_lastRegexString = regex;
|
_lastRegexString = regex;
|
||||||
_lastCompileFlags = compileFlags;
|
_lastCompileFlags = compileFlags;
|
||||||
}
|
}
|
||||||
@ -449,11 +447,9 @@ bool BoostRegexSearch::SearchParameters::isLineEnd(Sci::Position position)
|
|||||||
|
|
||||||
const char *BoostRegexSearch::SubstituteByPosition(Document* doc, const char *text, Sci::Position *length) {
|
const char *BoostRegexSearch::SubstituteByPosition(Document* doc, const char *text, Sci::Position *length) {
|
||||||
delete[] _substituted;
|
delete[] _substituted;
|
||||||
std::locale l = std::locale::global(std::locale(""));
|
|
||||||
_substituted = (doc->CodePage() == SC_CP_UTF8)
|
_substituted = (doc->CodePage() == SC_CP_UTF8)
|
||||||
? _utf8.SubstituteByPosition(text, length)
|
? _utf8.SubstituteByPosition(text, length)
|
||||||
: _ansi.SubstituteByPosition(text, length);
|
: _ansi.SubstituteByPosition(text, length);
|
||||||
std::locale::global(l);
|
|
||||||
return _substituted;
|
return _substituted;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user