mirror of https://github.com/golang/go.git
gofmt: remove redundant check in rewriter
If the actual types of two reflect values are the same and the values are structs, they must have the same number of fields. LGTM=rsc R=rsc CC=golang-codereviews https://golang.org/cl/108280043
This commit is contained in:
parent
1abab32c65
commit
6a22823939
|
|
@ -226,9 +226,6 @@ func match(m map[string]reflect.Value, pattern, val reflect.Value) bool {
|
|||
return true
|
||||
|
||||
case reflect.Struct:
|
||||
if p.NumField() != v.NumField() {
|
||||
return false
|
||||
}
|
||||
for i := 0; i < p.NumField(); i++ {
|
||||
if !match(m, p.Field(i), v.Field(i)) {
|
||||
return false
|
||||
|
|
|
|||
Loading…
Reference in New Issue