(node NodeId)
| 134 | } |
| 135 | |
| 136 | func (s *RouterState) GetNeighbour(node NodeId) *Neighbour { |
| 137 | nIdx := slices.IndexFunc(s.Neighbours, func(neighbour *Neighbour) bool { |
| 138 | return neighbour.Id == node |
| 139 | }) |
| 140 | if nIdx == -1 { |
| 141 | return nil |
| 142 | } |
| 143 | return s.Neighbours[nIdx] |
| 144 | } |
no outgoing calls