[#1689] network,core/netmap: Replace Iterate*() functions with iterators

Change-Id: I4842a3160d74c56d99ea9465d4be2f0662080605
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2025-04-04 20:31:35 +03:00
parent e65d578ba9
commit 2d1232ce6d
6 changed files with 33 additions and 27 deletions

View file

@ -1,6 +1,8 @@
package network
import (
"iter"
"slices"
"sort"
"testing"
@ -58,10 +60,8 @@ func TestAddressGroup_FromIterator(t *testing.T) {
type testIterator []string
func (t testIterator) IterateAddresses(f func(string) bool) {
for i := range t {
f(t[i])
}
func (t testIterator) Addresses() iter.Seq[string] {
return slices.Values(t)
}
func (t testIterator) NumberOfAddresses() int {