Optimizing some bytes.
parent
3c185aa40f
commit
2604347e8b
|
@ -12,11 +12,10 @@ import (
|
||||||
func (mip *AbstractMulticast) AddUniqueAndSort(hier int64) {
|
func (mip *AbstractMulticast) AddUniqueAndSort(hier int64) {
|
||||||
|
|
||||||
if slices.Contains(mip.HierarchyArray, hier) {
|
if slices.Contains(mip.HierarchyArray, hier) {
|
||||||
log.Println("Element already in the array:", hier)
|
log.Println("Element already in the array: ", hier)
|
||||||
} else {
|
} else {
|
||||||
mip.HierarchyArray = append(mip.HierarchyArray, hier)
|
mip.HierarchyArray = append(mip.HierarchyArray, hier)
|
||||||
log.Println("Here the numbers known:", mip.HierarchyArray)
|
log.Println("Here the numbers known:", mip.HierarchyArray)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -132,6 +131,7 @@ func (b *AbstractBridge) WaitAndClean(entity AbstractMulticast) {
|
||||||
// svuotare l'array e rifare le elezioni
|
// svuotare l'array e rifare le elezioni
|
||||||
if !isActive(string(brIp.String())) {
|
if !isActive(string(brIp.String())) {
|
||||||
entity.HierarchyArray = entity.HierarchyArray[:0]
|
entity.HierarchyArray = entity.HierarchyArray[:0]
|
||||||
|
entity.HierarchyArray = slices.Clip(entity.HierarchyArray)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue