Chore: improve programming style (#109)

This commit is contained in:
beyondkmp 2019-01-29 23:46:18 +08:00 committed by Dreamacro
parent 36b5d1f18f
commit 5581698908

View file

@ -153,12 +153,10 @@ func (t *Tunnel) match(metadata *C.Metadata) C.Proxy {
for _, rule := range t.rules {
if rule.IsMatch(metadata) {
a, ok := t.proxies[rule.Adapter()]
if !ok {
continue
if a, ok := t.proxies[rule.Adapter()]; ok {
log.Infoln("%v match %s using %s", metadata.String(), rule.RuleType().String(), rule.Adapter())
return a
}
log.Infoln("%v match %s using %s", metadata.String(), rule.RuleType().String(), rule.Adapter())
return a
}
}
log.Infoln("%v doesn't match any rule using DIRECT", metadata.String())