Merge pull request #890 from weaveworks/refactor-deepequal

refactoring deepequal to satisfy linter
This commit is contained in:
Tom Wilkie
2016-02-01 06:30:38 -08:00
5 changed files with 135 additions and 117 deletions

View File

@@ -108,12 +108,7 @@ func (c Counters) String() string {
}
// DeepEqual tests equality with other Counters
func (c Counters) DeepEqual(i interface{}) bool {
d, ok := i.(Counters)
if !ok {
return false
}
func (c Counters) DeepEqual(d Counters) bool {
if (c.psMap == nil) != (d.psMap == nil) {
return false
} else if c.psMap == nil && d.psMap == nil {

View File

@@ -128,12 +128,7 @@ func (c EdgeMetadatas) String() string {
}
// DeepEqual tests equality with other Counters
func (c EdgeMetadatas) DeepEqual(i interface{}) bool {
d, ok := i.(EdgeMetadatas)
if !ok {
return false
}
func (c EdgeMetadatas) DeepEqual(d EdgeMetadatas) bool {
if c.Size() != d.Size() {
return false
}

View File

@@ -142,12 +142,7 @@ func (m LatestMap) String() string {
}
// DeepEqual tests equality with other LatestMap
func (m LatestMap) DeepEqual(i interface{}) bool {
n, ok := i.(LatestMap)
if !ok {
return false
}
func (m LatestMap) DeepEqual(n LatestMap) bool {
if m.Size() != n.Size() {
return false
}

View File

@@ -104,12 +104,7 @@ func (s Sets) String() string {
}
// DeepEqual tests equality with other Sets
func (s Sets) DeepEqual(i interface{}) bool {
t, ok := i.(Sets)
if !ok {
return false
}
func (s Sets) DeepEqual(t Sets) bool {
if s.psMap.Size() != t.psMap.Size() {
return false
}