X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libgo%2Fgo%2Freflect%2Fdeepequal.go;h=db047963eb175c11f3bcae27ddb4246381763033;hb=4d8cd3a26294ce35abb17668eac2b6c38dd23bd0;hp=c12e90f36ccc229b5ad29d6bcabcf70ce1060442;hpb=c944d49b3bd3667c65c299afd3b1d756084203f4;p=platform%2Fupstream%2Fgcc48.git diff --git a/libgo/go/reflect/deepequal.go b/libgo/go/reflect/deepequal.go index c12e90f..db04796 100644 --- a/libgo/go/reflect/deepequal.go +++ b/libgo/go/reflect/deepequal.go @@ -122,9 +122,12 @@ func deepValueEqual(v1, v2 Value, visited map[uintptr]*visit, depth int) (b bool panic("Not reached") } -// DeepEqual tests for deep equality. It uses normal == equality where possible -// but will scan members of arrays, slices, maps, and fields of structs. It correctly -// handles recursive types. Functions are equal only if they are both nil. +// DeepEqual tests for deep equality. It uses normal == equality where +// possible but will scan elements of arrays, slices, maps, and fields of +// structs. In maps, keys are compared with == but elements use deep +// equality. DeepEqual correctly handles recursive types. Functions are equal +// only if they are both nil. +// An empty slice is not equal to a nil slice. func DeepEqual(a1, a2 interface{}) bool { if a1 == nil || a2 == nil { return a1 == a2