Merge type comparison into a single function call

This commit is contained in:
James Shubin
2016-01-08 04:13:42 -05:00
parent d769309cc0
commit 45ff3b6aa4
3 changed files with 27 additions and 36 deletions

View File

@@ -294,15 +294,12 @@ func (obj *NoopType) Compare(typ Type) bool {
switch typ.(type) {
// we can only compare NoopType to others of the same type
case *NoopType:
return obj.compare(typ.(*NoopType))
typ := typ.(*NoopType)
if obj.Name != typ.Name {
return false
}
default:
return false
}
}
func (obj *NoopType) compare(typ *NoopType) bool {
if obj.Name != typ.Name {
return false
}
return true
}