11package nmagent
22
3- // equalPtr compares two Interfaces objects for equality.
4- func (i * Interfaces ) equalPtr (other * Interfaces ) bool {
3+ // Equal compares two Interfaces objects for equality.
4+ func (i Interfaces ) Equal (other Interfaces ) bool {
55 if len (i .Entries ) != len (other .Entries ) {
66 return false
77 }
88 for idx , entry := range i .Entries {
9- if ! entry .equalPtr ( & other .Entries [idx ]) {
9+ if ! entry .Equal ( other .Entries [idx ]) {
1010 return false
1111 }
1212 }
1313 return true
1414}
1515
16- // Equal compares two Interfaces objects for equality.
17- func (i Interfaces ) Equal (other Interfaces ) bool {
18- return i .equalPtr (& other )
19- }
20-
21- // equalPtr compares two Interface objects for equality.
22- func (i * Interface ) equalPtr (other * Interface ) bool {
16+ // Equal compares two Interface objects for equality.
17+ func (i Interface ) Equal (other Interface ) bool {
2318 if len (i .InterfaceSubnets ) != len (other .InterfaceSubnets ) {
2419 return false
2520 }
2621 for idx , subnet := range i .InterfaceSubnets {
27- if ! subnet .equalPtr ( & other .InterfaceSubnets [idx ]) {
22+ if ! subnet .Equal ( other .InterfaceSubnets [idx ]) {
2823 return false
2924 }
3025 }
@@ -34,38 +29,23 @@ func (i *Interface) equalPtr(other *Interface) bool {
3429 return true
3530}
3631
37- // Equal compares two Interface objects for equality.
38- func (i Interface ) Equal (other Interface ) bool {
39- return i .equalPtr (& other )
40- }
41-
42- // equalPtr compares two InterfaceSubnet objects for equality.
43- func (s * InterfaceSubnet ) equalPtr (other * InterfaceSubnet ) bool {
32+ // Equal compares two InterfaceSubnet objects for equality.
33+ func (s InterfaceSubnet ) Equal (other InterfaceSubnet ) bool {
4434 if len (s .IPAddress ) != len (other .IPAddress ) {
4535 return false
4636 }
4737 if s .Prefix != other .Prefix {
4838 return false
4939 }
5040 for idx , ip := range s .IPAddress {
51- if ! ip .equalPtr ( & other .IPAddress [idx ]) {
41+ if ! ip .Equal ( other .IPAddress [idx ]) {
5242 return false
5343 }
5444 }
5545 return true
5646}
5747
58- // Equal compares two InterfaceSubnet objects for equality.
59- func (s InterfaceSubnet ) Equal (other InterfaceSubnet ) bool {
60- return s .equalPtr (& other )
61- }
62-
63- // equalPtr compares two NodeIP objects for equality.
64- func (ip * NodeIP ) equalPtr (other * NodeIP ) bool {
65- return ip .IsPrimary == other .IsPrimary && ip .Address .Equal (other .Address )
66- }
67-
6848// Equal compares two NodeIP objects for equality.
6949func (ip NodeIP ) Equal (other NodeIP ) bool {
70- return ip .equalPtr ( & other )
50+ return ip .IsPrimary == other . IsPrimary && ip . Address . Equal ( other . Address )
7151}
0 commit comments