aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java
index a8296771a..d067d2ddc 100644
--- a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java
@@ -238,15 +238,11 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder {
if (type == MSG_EXTENDED_RECORDS) {
int recordExtension = buf.readUnsignedByte();
- int noRecordsToMerge = BitUtil.between(recordExtension, 4, 8);
+ int mergeRecordCount = BitUtil.between(recordExtension, 4, 8);
int currentRecord = BitUtil.to(recordExtension, 4);
- if (currentRecord > 0 && currentRecord <= noRecordsToMerge) {
- if (!positions.isEmpty()
- && positions.get(positions.size() - 1).getDeviceTime()
- .compareTo(position.getDeviceTime()) == 0) {
- position = positions.remove(positions.size() - 1);
- }
+ if (currentRecord > 0 && currentRecord <= mergeRecordCount) {
+ position = positions.remove(positions.size() - 1);
}
}