Repository navigation
検索パターンが検索語とオプションを写して持つ - #2872
Merged
berryzplus merged 1 commit intoNov 18, 2026
Merged
Conversation
Test Results2 074 tests +22 2 074 ✅ +22 13m 46s ⏱️ + 1m 18s Results for commit 1354f37. ± Comparison against base commit 7378fdf. This pull request removes 6 and adds 28 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
hpmy-dev
force-pushed
the
refactor/search_pattern_owns_key
branch
from
November 17, 2026 12:34
b07ee90 to
1354f37
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



#2865 の対応 2〜5 です。
ここで一旦止めます。
CSearchStringPatternは、SetPattern()に渡された検索語・置換後文字列・検索オプションを指すだけでした。後で呼び出し側が書き換えると、
SetPattern()で作った小文字の検索語や読み飛ばす幅の表と食い違うことがあるので、写して持つ形にします。変更内容
std::wstring・std::optional<std::wstring>、検索オプションをSSearchOptionの値で持ちますstd::wstring・std::vector<int>にします。new[]・delete[]、初期値の無いm_nPatternLen、デストラクターが無くなりますSearchString()がnullptrを返しますSetPattern()の引数とCBregexpの持ち方は変えていません。SearchString()のループは次の PR で整理しますテスト
nullptr、設定の前の値SetKey()をし直していたテストを、条件ごとのテストに分けました。確かめる値は変えていません
ASSERT_THAT(SetKey(...), IsTrue())は残しています。SetKey()が失敗すると後ろの確かめに意味が無いので、前提としてASSERT_にしています。分けたので、止まるのはその条件のテストだけですCSearchAgentSearchTest.*・CLineMatchFinderTest.*・CompileRegexpTest.*・CSearchStringPattern.*・GrepParallelTest.*の 126 件が成功関連 issue, PR
CSearchAgent::SearchString()・CSearchStringPattern::SetPattern())を作り直す #2865