From cba51a2052fe2ce0e258247e6d9b5d6663026d49 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Sat, 7 May 2016 14:13:21 +0200 Subject: [PATCH] Fix: All values need to be evaluated, switch is bad --- main.go | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 6fc4a16..d4ecca2 100644 --- a/main.go +++ b/main.go @@ -205,14 +205,16 @@ func main() { } hydrants = append(hydrants, h) - switch { - case minLat > h.Latitude: + if minLat > h.Latitude { minLat = h.Latitude - case maxLat < h.Latitude: + } + if maxLat < h.Latitude { maxLat = h.Latitude - case minLon > h.Longitude: + } + if minLon > h.Longitude { minLon = h.Longitude - case maxLon < h.Longitude: + } + if maxLon < h.Longitude { maxLon = h.Longitude } }