diff options
-rw-r--r-- | src/org/traccar/database/DataManager.java | 1 | ||||
-rw-r--r-- | src/org/traccar/helper/LocationTree.java | 10 |
2 files changed, 4 insertions, 7 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java index d9a1439f2..7baa1df47 100644 --- a/src/org/traccar/database/DataManager.java +++ b/src/org/traccar/database/DataManager.java @@ -44,7 +44,6 @@ import org.traccar.helper.Log; import org.traccar.model.Device; import org.traccar.model.Group; import org.traccar.model.GroupPermission; -import org.traccar.model.MiscFormatter; import org.traccar.model.DevicePermission; import org.traccar.model.Position; import org.traccar.model.Server; 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; } } |