1
0
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:
Darien Raymond
2018-09-08 21:54:09 +02:00
parent 2ff93c65f3
commit 7b28a19013
2 changed files with 16 additions and 0 deletions

View File

@@ -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 {