Skip to content

Commit

Permalink
Improve name to make it less confusing
Browse files Browse the repository at this point in the history
  • Loading branch information
oschwald committed Nov 13, 2024
1 parent 8f32dec commit 0ca2750
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions traverse.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ func IncludeAliasedNetworks(networks *networkOptions) {
networks.includeAliasedNetworks = true
}

// IncludeEmptyNetworks is an option for Networks and NetworksWithin
// IncludeNetworksWithoutData is an option for Networks and NetworksWithin
// that makes them include networks without any data in the iteration.
func IncludeEmptyNetworks(networks *networkOptions) {
func IncludeNetworksWithoutData(networks *networkOptions) {
networks.includeEmptyNetworks = true
}

Expand All @@ -49,7 +49,7 @@ func IncludeEmptyNetworks(networks *networkOptions) {
// [IncludeAliasedNetworks] option.
//
// Networks without data are excluded by default. To include them, use
// [IncludeEmptyNetworks].
// [IncludeNetworksWithoutData].
func (r *Reader) Networks(options ...NetworksOption) iter.Seq[Result] {
if r.Metadata.IPVersion == 6 {
return r.NetworksWithin(allIPv6, options...)
Expand All @@ -69,7 +69,7 @@ func (r *Reader) Networks(options ...NetworksOption) iter.Seq[Result] {
// iterator will iterate over exactly one network, the containing network.
//
// Networks without data are excluded by default. To include them, use
// [IncludeEmptyNetworks].
// [IncludeNetworksWithoutData].
func (r *Reader) NetworksWithin(prefix netip.Prefix, options ...NetworksOption) iter.Seq[Result] {
return func(yield func(Result) bool) {
if r.Metadata.IPVersion == 4 && prefix.Addr().Is6() {
Expand Down
2 changes: 1 addition & 1 deletion traverse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ var tests = []networkTest{
"1.64.0.0/10",
"1.128.0.0/9",
},
Options: []NetworksOption{IncludeEmptyNetworks},
Options: []NetworksOption{IncludeNetworksWithoutData},
},
{
Network: "1.1.1.16/28",
Expand Down

0 comments on commit 0ca2750

Please sign in to comment.