diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-04-17 11:22:23 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-04-17 11:22:23 +1200 |
commit | da095966b77c931c5e0f6209cc7ba33cd72a1953 (patch) | |
tree | f6f9d95e15f2125a0bf74587415cf417becdbe67 /src/org/traccar/helper/LocationTree.java | |
parent | f5b61271e37c87d7f598820553734e518d9599c1 (diff) | |
download | trackermap-server-da095966b77c931c5e0f6209cc7ba33cd72a1953.tar.gz trackermap-server-da095966b77c931c5e0f6209cc7ba33cd72a1953.tar.bz2 trackermap-server-da095966b77c931c5e0f6209cc7ba33cd72a1953.zip |
Fix static code analysis issues
Diffstat (limited to 'src/org/traccar/helper/LocationTree.java')
-rw-r--r-- | src/org/traccar/helper/LocationTree.java | 10 |
1 files changed, 4 insertions, 6 deletions
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; } } |