feat(aa): be more verbose on rule.Merge
This commit is contained in:
parent
880f0ef37e
commit
7c006dee0a
11 changed files with 69 additions and 29 deletions
|
|
@ -89,6 +89,20 @@ func (r *Signal) Validate() error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (r *Signal) Compare(other Rule) int {
|
||||
o, _ := other.(*Signal)
|
||||
if res := compare(r.Access, o.Access); res != 0 {
|
||||
return res
|
||||
}
|
||||
if res := compare(r.Set, o.Set); res != 0 {
|
||||
return res
|
||||
}
|
||||
if res := compare(r.Peer, o.Peer); res != 0 {
|
||||
return res
|
||||
}
|
||||
return r.Qualifier.Compare(o.Qualifier)
|
||||
}
|
||||
|
||||
func (r *Signal) Merge(other Rule) bool {
|
||||
o, _ := other.(*Signal)
|
||||
|
||||
|
|
@ -107,17 +121,3 @@ func (r *Signal) Merge(other Rule) bool {
|
|||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (r *Signal) Compare(other Rule) int {
|
||||
o, _ := other.(*Signal)
|
||||
if res := compare(r.Access, o.Access); res != 0 {
|
||||
return res
|
||||
}
|
||||
if res := compare(r.Set, o.Set); res != 0 {
|
||||
return res
|
||||
}
|
||||
if res := compare(r.Peer, o.Peer); res != 0 {
|
||||
return res
|
||||
}
|
||||
return r.Qualifier.Compare(o.Qualifier)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue