From bc40685dca74e5026d529456ee01e6a7627fb85e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 18 Oct 2016 20:27:42 +1300 Subject: Small modifications to filter handler --- src/org/traccar/FilterHandler.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/FilterHandler.java b/src/org/traccar/FilterHandler.java index e9e3245a6..83d79a3c0 100644 --- a/src/org/traccar/FilterHandler.java +++ b/src/org/traccar/FilterHandler.java @@ -150,8 +150,7 @@ public class FilterHandler extends BaseDataHandler { private boolean filter(Position position) { - boolean result = false; - StringBuilder filterType = new StringBuilder(8 + 5 + 10 + 7 + 12 + 7 + 9); + StringBuilder filterType = new StringBuilder(); if (filterInvalid(position)) { filterType.append("Invalid "); @@ -175,19 +174,12 @@ public class FilterHandler extends BaseDataHandler { filterType.append("Distance "); } - if (filterType.length() > 0) { - result = true; - } - - if (filterLimit(position)) { - result = false; - } - - if (result) { + if (filterType.length() > 0 && !filterLimit(position)) { Log.info("Position filtered by " + filterType.toString() + "filters from " + position.getDeviceId()); + return true; } - return result; + return false; } @Override -- cgit v1.2.3