Safer string compare
parent
0e5f76f9bd
commit
9b5443b341
|
@ -4,6 +4,7 @@ import (
|
|||
"fmt"
|
||||
"log"
|
||||
"slices"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -30,7 +31,7 @@ func (mip *AbstractMulticast) IsAlpha(hier string) bool {
|
|||
alpha := mip.HierarchyArray[indexMax]
|
||||
log.Println("Maximum element is :", alpha)
|
||||
log.Println("Array is :", mip.HierarchyArray)
|
||||
return alpha == hier
|
||||
return strings.Compare(alpha, hier) == 0
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue