aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-10-18 20:27:42 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-10-18 20:27:42 +1300
commitbc40685dca74e5026d529456ee01e6a7627fb85e (patch)
treef296ec2451915d7712bc5aebadbbce2164023d6f /src
parent42515694997bbcaf9abd85ece7586f84ff3065e7 (diff)
downloadtraccar-server-bc40685dca74e5026d529456ee01e6a7627fb85e.tar.gz
traccar-server-bc40685dca74e5026d529456ee01e6a7627fb85e.tar.bz2
traccar-server-bc40685dca74e5026d529456ee01e6a7627fb85e.zip
Small modifications to filter handler
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/FilterHandler.java16
1 files changed, 4 insertions, 12 deletions
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