Skip to content

Commit a99199b

Browse files
committed
Cleanup unused ignore_multiple_skipped_results_ field that is unneeded now that skipped matchers are handled via callback instead of recorded to a vector
Signed-off-by: Brian Surber <[email protected]>
1 parent f05db5e commit a99199b

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

source/common/matcher/matcher.h

+2-6
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,8 @@ static inline MaybeMatchResult evaluateMatch(MatchTree<DataType>& match_tree, co
8484
// Re-entry helper class to track and match against nested reentrants for a MatchTree.
8585
template <class DataType> class ReenterableMatchEvaluator {
8686
public:
87-
ReenterableMatchEvaluator(std::shared_ptr<MatchTree<DataType>> match_tree,
88-
bool ignore_multiple_skipped_results)
89-
: match_tree_(match_tree), ignore_multiple_skipped_results_(ignore_multiple_skipped_results) {
90-
}
87+
ReenterableMatchEvaluator(std::shared_ptr<MatchTree<DataType>> match_tree)
88+
: match_tree_(match_tree) {}
9189

9290
// Match against the reentrant stack (bottom up), cleaning up any that no longer find a match.
9391
MaybeMatchResult evaluateMatch(const DataType& data,
@@ -198,8 +196,6 @@ template <class DataType> class ReenterableMatchEvaluator {
198196
// MatchTree to use for the initial match.
199197
std::shared_ptr<MatchTree<DataType>> match_tree_;
200198
std::unique_ptr<ReentrantEntry> reentrant_stack_ = nullptr;
201-
// Only record the first skipped result.
202-
bool ignore_multiple_skipped_results_ = false;
203199
};
204200

205201
template <class DataType> using FieldMatcherFactoryCb = std::function<FieldMatcherPtr<DataType>()>;

test/common/matcher/matcher_test.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -879,7 +879,7 @@ TEST_P(MatcherAmbiguousTest, ReentryWithRecursiveMatcher) {
879879
std::shared_ptr<MatchTree<TestData>> top_matcher = createMatcherFromYaml(yaml)();
880880

881881
// Expect to hit each match once via repeated re-entry, including the recursive on-no-match.
882-
ReenterableMatchEvaluator<TestData> reenterable_matcher(top_matcher, false);
882+
ReenterableMatchEvaluator<TestData> reenterable_matcher(top_matcher);
883883
std::vector<ActionFactoryCb> skipped_results;
884884
SkippedMatchCb<TestData> skipped_match_cb = [&skipped_results](const OnMatch<TestData>& match) {
885885
skipped_results.push_back(match.action_cb_);
@@ -1067,7 +1067,7 @@ TEST_P(MatcherAmbiguousTest, ReentryWithNestedPreviewMatchers) {
10671067
// keep_matching setting. The third nested match and on_no_match are not reached as the parent
10681068
// matcher has finished recursion with the second match, which would have been its returned action
10691069
// if the parent matcher wasn't skipped.
1070-
ReenterableMatchEvaluator<TestData> reenterable_matcher(top_matcher, false);
1070+
ReenterableMatchEvaluator<TestData> reenterable_matcher(top_matcher);
10711071
std::vector<ActionFactoryCb> skipped_results;
10721072
SkippedMatchCb<TestData> skipped_match_cb = [&skipped_results](const OnMatch<TestData>& match) {
10731073
skipped_results.push_back(match.action_cb_);
@@ -1122,7 +1122,7 @@ TEST_P(MatcherAmbiguousTest, KeepMatchingWithUnsupportedReentry) {
11221122
validation_visitor_.setSupportKeepMatching(true);
11231123
std::shared_ptr<MatchTree<TestData>> matcher = createMatcherFromYaml(yaml)();
11241124

1125-
ReenterableMatchEvaluator<TestData> reenterable_matcher(matcher, false);
1125+
ReenterableMatchEvaluator<TestData> reenterable_matcher(matcher);
11261126
std::vector<ActionFactoryCb> skipped_results;
11271127
SkippedMatchCb<TestData> skipped_match_cb = [&skipped_results](const OnMatch<TestData>& match) {
11281128
skipped_results.push_back(match.action_cb_);

0 commit comments

Comments
 (0)