mirror of
https://github.com/tim-beatham/smegmesh.git
synced 2025-08-14 07:18:32 +02:00
51-bugfix-routes-not-removing-when-withdrawn
- Routes are not being removed despite being withdrawn from the configuration. - Best path routes are not shared across interfaces - Bug in consistent hashing wrong parameter passed caused by refactorings.
This commit is contained in:
@ -7,6 +7,27 @@ func MapValues[K cmp.Ordered, V any](m map[K]V) []V {
|
||||
return MapValuesWithExclude(m, map[K]struct{}{})
|
||||
}
|
||||
|
||||
type MapItemsEntry[K cmp.Ordered, V any] struct {
|
||||
Key K
|
||||
Value V
|
||||
}
|
||||
|
||||
func MapItems[K cmp.Ordered, V any](m map[K]V) []MapItemsEntry[K, V] {
|
||||
keys := MapKeys(m)
|
||||
values := MapValues(m)
|
||||
|
||||
vs := make([]MapItemsEntry[K, V], len(keys))
|
||||
|
||||
for index, _ := range keys {
|
||||
vs[index] = MapItemsEntry[K, V]{
|
||||
Key: keys[index],
|
||||
Value: values[index],
|
||||
}
|
||||
}
|
||||
|
||||
return vs
|
||||
}
|
||||
|
||||
func MapValuesWithExclude[K cmp.Ordered, V any](m map[K]V, exclude map[K]struct{}) []V {
|
||||
values := make([]V, len(m)-len(exclude))
|
||||
|
||||
|
Reference in New Issue
Block a user