mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-08 02:36:27 -05:00
Make Equals compare by Ref (after comparing TypeRef)
This changes equal to compare by ref. Since computing the ref can be expensive we first check that the type refs are equal. Fixes #532
This commit is contained in:
@@ -47,10 +47,7 @@ func (s {{.Name}}) InternalImplementation() {{$typesPackage}}Set {
|
||||
}
|
||||
|
||||
func (s {{.Name}}) Equals(other {{$typesPackage}}Value) bool {
|
||||
if other, ok := other.({{.Name}}); ok {
|
||||
return s.Ref() == other.Ref()
|
||||
}
|
||||
return false
|
||||
return other != nil && __typeRefFor{{.Name}}.Equals(other.TypeRef()) && s.Ref() == other.Ref()
|
||||
}
|
||||
|
||||
func (s {{.Name}}) Ref() ref.Ref {
|
||||
|
||||
Reference in New Issue
Block a user