This commit is contained in:
nikk gitanes
2023-02-18 23:23:11 +03:00
parent ec4deb8afe
commit 7822157ff2
22 changed files with 62 additions and 69 deletions

View File

@@ -68,7 +68,7 @@ func (ipl *IPList) Lookup(ip net.IP) (r Range, ok bool) {
// Return the range the given IP is in. Returns nil if no range is found.
func (ipl *IPList) lookup(ip net.IP) (Range, bool) {
var rng Range
var ok = false
ok := false
for _, r := range ipl.ranges {
ok = bytes.Compare(r.First, ip) <= 0 && bytes.Compare(ip, r.Last) <= 0
if ok {