mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-29 13:35:20 -05:00
improve domain matcher performance
This commit is contained in:
@@ -11,6 +11,8 @@ func TestDomainMatcherGroup(t *testing.T) {
|
||||
g.Add("v2ray.com", 1)
|
||||
g.Add("google.com", 2)
|
||||
g.Add("x.a.com", 3)
|
||||
g.Add("a.b.com", 4)
|
||||
g.Add("c.a.b.com", 5)
|
||||
|
||||
testCases := []struct {
|
||||
Domain string
|
||||
@@ -24,6 +26,14 @@ func TestDomainMatcherGroup(t *testing.T) {
|
||||
Domain: "y.com",
|
||||
Result: 0,
|
||||
},
|
||||
{
|
||||
Domain: "a.b.com",
|
||||
Result: 4,
|
||||
},
|
||||
{
|
||||
Domain: "c.a.b.com",
|
||||
Result: 4,
|
||||
},
|
||||
}
|
||||
|
||||
for _, testCase := range testCases {
|
||||
|
||||
Reference in New Issue
Block a user