]> Cypherpunks repositories - gostls13.git/commitdiff
reflect: remove length check for arrays in deepValueEqual
authorShawn Smith <shawn.p.smith@gmail.com>
Sun, 29 Dec 2013 19:05:30 +0000 (11:05 -0800)
committerIan Lance Taylor <iant@golang.org>
Sun, 29 Dec 2013 19:05:30 +0000 (11:05 -0800)
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/39910044

src/pkg/reflect/deepequal.go

index e3bf3dcac0c7f49fb73e86322b7d3a5e643184aa..f63715c9afc9862681422180aa4ba08b078215c2 100644 (file)
@@ -62,9 +62,6 @@ func deepValueEqual(v1, v2 Value, visited map[visit]bool, depth int) bool {
 
        switch v1.Kind() {
        case Array:
-               if v1.Len() != v2.Len() {
-                       return false
-               }
                for i := 0; i < v1.Len(); i++ {
                        if !deepValueEqual(v1.Index(i), v2.Index(i), visited, depth+1) {
                                return false