Skip to content

Commit

Permalink
simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
gaissmai committed Aug 29, 2024
1 parent 8ffb23c commit 7139e25
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions stringify.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,7 @@ func cidrFromPath(path [16]byte, depth int, is4 bool, idx uint) (netip.Prefix, e
// make ip addr from octets
var ip netip.Addr
if is4 {
// convert slice to array pointer
a4 := (*[4]byte)(path[:4])
ip = netip.AddrFrom4(*a4)
ip = netip.AddrFrom4([4]byte(path[:4]))
} else {
ip = netip.AddrFrom16(path)
}
Expand Down

0 comments on commit 7139e25

Please sign in to comment.