1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-14 09:39:17 -04:00
This commit is contained in:
Darien Raymond
2017-05-08 11:48:41 +02:00
parent 5dbfd75542
commit a0ac334703
2 changed files with 31 additions and 19 deletions

View File

@@ -245,8 +245,14 @@ type UserMatcher struct {
}
func NewUserMatcher(users []string) *UserMatcher {
usersCopy := make([]string, 0, len(users))
for _, user := range users {
if len(user) > 0 {
usersCopy = append(usersCopy, user)
}
}
return &UserMatcher{
user: users,
user: usersCopy,
}
}
@@ -268,8 +274,14 @@ type InboundTagMatcher struct {
}
func NewInboundTagMatcher(tags []string) *InboundTagMatcher {
tagsCopy := make([]string, 0, len(tags))
for _, tag := range tags {
if len(tag) > 0 {
tagsCopy = append(tagsCopy, tag)
}
}
return &InboundTagMatcher{
tags: tags,
tags: tagsCopy,
}
}