Skip to content

Commit

Permalink
Use len of map to check for empty map.
Browse files Browse the repository at this point in the history
  • Loading branch information
djw8605 committed Mar 22, 2022
1 parent eb688b3 commit f23e6de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion map.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func mapIp(remote *net.UDPAddr) string {
if mapAll != "" {
return mapAll
}
if ipMap == nil || len(ipMap) == 0 {
if len(ipMap) == 0 {
return remote.IP.String()
}
return ipMap[remote.IP.String()]
Expand Down

0 comments on commit f23e6de

Please sign in to comment.