From 3421a6e2679dc2c1d49eeb32b253a848de641e94 Mon Sep 17 00:00:00 2001 From: Torrie Fischer Date: Wed, 25 Apr 2012 16:25:07 -0400 Subject: [PATCH] code cleanup --- src/main/java/us/camin/regions/RegionManager.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/us/camin/regions/RegionManager.java b/src/main/java/us/camin/regions/RegionManager.java index c3dc87e..cacb9a1 100644 --- a/src/main/java/us/camin/regions/RegionManager.java +++ b/src/main/java/us/camin/regions/RegionManager.java @@ -117,12 +117,9 @@ public class RegionManager { int minDistance = -1; for(Region r : regions) { int check = distance(loc, r.location()); - if (minDistance == -1) { + if (minDistance == -1 || check < minDistance) { nearest = r; minDistance = check; - } else if (check < minDistance) { - nearest = r; - minDistance = check; } } return nearest;