1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 01:57:12 -05:00

Move code to init

This commit is contained in:
v2ray 2015-12-14 01:12:29 +01:00
parent d3422597d6
commit 543478a01e

View File

@ -37,9 +37,13 @@ const (
)
var (
compiledMatchers []*RegexpDomainMatcher
)
func init() {
compiledMatchers = make([]*RegexpDomainMatcher, 0, 1024)
regexpDomains = []string{
regexpDomains := []string{
dotCn,
anySubDomain + "10010" + dotCom,
@ -187,9 +191,7 @@ var (
anySubDomain + "youku" + dotCom,
anySubDomain + "zhihu" + dotCom,
}
)
func init() {
for _, pattern := range regexpDomains {
matcher, err := NewRegexpDomainMatcher(pattern)
if err != nil {