Simplified false check

This commit is contained in:
Mike Raunsbæk 2018-06-28 17:51:32 +02:00
parent e0ff53bb45
commit 988e43e661
1 changed files with 2 additions and 2 deletions

View File

@ -89,10 +89,10 @@ func (g *geoip) City(ip net.IP) (City, error) {
if c, exists := record.City.Names["en"]; exists {
city.Name = c
}
if math.IsNaN(record.Location.Latitude) == false {
if !math.IsNaN(record.Location.Latitude) {
city.Latitude = record.Location.Latitude
}
if math.IsNaN(record.Location.Longitude) == false {
if !math.IsNaN(record.Location.Longitude) {
city.Longitude = record.Location.Longitude
}
return city, nil