From da095966b77c931c5e0f6209cc7ba33cd72a1953 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sun, 17 Apr 2016 11:22:23 +1200 Subject: Fix static code analysis issues --- src/org/traccar/helper/LocationTree.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/org/traccar/helper/LocationTree.java') diff --git a/src/org/traccar/helper/LocationTree.java b/src/org/traccar/helper/LocationTree.java index 3c2d2ff92..5e16fc095 100644 --- a/src/org/traccar/helper/LocationTree.java +++ b/src/org/traccar/helper/LocationTree.java @@ -112,12 +112,10 @@ public class LocationTree { if (current.squaredDistance(search) < best.squaredDistance(search)) { best = current; } - if (other != null) { - if (current.axisSquaredDistance(search, depth % 2) < best.squaredDistance(search)) { - Item possibleBest = findNearest(other, search, depth + 1); - if (possibleBest.squaredDistance(search) < best.squaredDistance(search)) { - best = possibleBest; - } + if (other != null && current.axisSquaredDistance(search, depth % 2) < best.squaredDistance(search)) { + Item possibleBest = findNearest(other, search, depth + 1); + if (possibleBest.squaredDistance(search) < best.squaredDistance(search)) { + best = possibleBest; } } -- cgit v1.2.3