mirror of
https://github.com/coredns/coredns.git
synced 2026-05-26 03:40:23 -04:00
Remove redundant code (#8072)
Signed-off-by: Yang Jun <yang.jun22@zte.com.cn> Signed-off-by: 杨军10092085 <yang.jun22@zte.com.cn>
This commit is contained in:
@@ -168,11 +168,6 @@ func (z *Zone) Lookup(ctx context.Context, state request.Request, qname string)
|
|||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
|
|
||||||
// What does found and !shot mean - do we ever hit it?
|
|
||||||
if found && !shot {
|
|
||||||
return nil, nil, nil, ServerFailure
|
|
||||||
}
|
|
||||||
|
|
||||||
// Found entire name.
|
// Found entire name.
|
||||||
if found && shot {
|
if found && shot {
|
||||||
if rrs := elem.Type(dns.TypeCNAME); len(rrs) > 0 && qtype != dns.TypeCNAME {
|
if rrs := elem.Type(dns.TypeCNAME); len(rrs) > 0 && qtype != dns.TypeCNAME {
|
||||||
|
|||||||
@@ -371,11 +371,8 @@ func parseAnswerRules(name string, args []string) (auto bool, rules ResponseRule
|
|||||||
}
|
}
|
||||||
for arg < len(args) {
|
for arg < len(args) {
|
||||||
if last == "" && args[arg] != AnswerMatch {
|
if last == "" && args[arg] != AnswerMatch {
|
||||||
if last == "" {
|
|
||||||
return false, nil, fmt.Errorf("exceeded the number of arguments for a non-answer rule argument for %s rule", name)
|
return false, nil, fmt.Errorf("exceeded the number of arguments for a non-answer rule argument for %s rule", name)
|
||||||
}
|
}
|
||||||
return false, nil, fmt.Errorf("exceeded the number of arguments for %s answer rule for %s rule", last, name)
|
|
||||||
}
|
|
||||||
if args[arg] == AnswerMatch {
|
if args[arg] == AnswerMatch {
|
||||||
arg++
|
arg++
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user