mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-03-13 10:26:06 +00:00
refactor: remove unused StopOnFirstMatch field from MatchingConfig
Remove StopOnFirstMatch field that was defined but never used in the actual matching logic. The current implementation always evaluates all rule types and applies a fixed precedence (Domain > MAC > Network), making the StopOnFirstMatch field unnecessary. Changes: - Remove StopOnFirstMatch from MatchingConfig structs - Update DefaultMatchingConfig() function - Update all test cases and references - Simplify configuration to only include Order field This cleanup removes dead code and simplifies the configuration API without changing any functional behavior.
This commit is contained in:
committed by
Cuong Manh Le
parent
4c838f6a5e
commit
92f32ba16e
@@ -393,8 +393,7 @@ func (p *prog) upstreamFor(ctx context.Context, defaultUpstreamNum string, lc *c
|
||||
}
|
||||
|
||||
matchingConfig = &rulematcher.MatchingConfig{
|
||||
Order: order,
|
||||
StopOnFirstMatch: lc.Policy.Matching.StopOnFirstMatch,
|
||||
Order: order,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -170,8 +170,7 @@ func Test_prog_upstreamForWithCustomMatching(t *testing.T) {
|
||||
{"*.ru": []string{"upstream.1"}},
|
||||
},
|
||||
Matching: &ctrld.MatchingConfig{
|
||||
Order: []string{"domain", "mac", "network"},
|
||||
StopOnFirstMatch: true,
|
||||
Order: []string{"domain", "mac", "network"},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user