diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-11 12:34:38 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-02-11 12:34:38 +1300 |
commit | b70eddfcda8262ec4bf76213d414ef55950478d0 (patch) | |
tree | c302957f3999fcf571c93a62778defcd403b5851 /src/org/traccar/protocol/At2000FrameDecoder.java | |
parent | c8fa36318702acc9ff54d3811e1f32c1035e85f3 (diff) | |
download | trackermap-server-b70eddfcda8262ec4bf76213d414ef55950478d0.tar.gz trackermap-server-b70eddfcda8262ec4bf76213d414ef55950478d0.tar.bz2 trackermap-server-b70eddfcda8262ec4bf76213d414ef55950478d0.zip |
Fix some code issues
Diffstat (limited to 'src/org/traccar/protocol/At2000FrameDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/At2000FrameDecoder.java | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/org/traccar/protocol/At2000FrameDecoder.java b/src/org/traccar/protocol/At2000FrameDecoder.java index f87dc3885..af257d0fb 100644 --- a/src/org/traccar/protocol/At2000FrameDecoder.java +++ b/src/org/traccar/protocol/At2000FrameDecoder.java @@ -65,12 +65,11 @@ public class At2000FrameDecoder extends FrameDecoder { length = (length / BLOCK_LENGTH + 1) * BLOCK_LENGTH; } - if (buf.readableBytes() >= length || buf.readableBytes() % ACK_LENGTH == 0) { - if (buf != currentBuffer || buf.readableBytes() > acknowledgedBytes) { - sendResponse(channel); - currentBuffer = buf; - acknowledgedBytes = buf.readableBytes(); - } + if ((buf.readableBytes() >= length || buf.readableBytes() % ACK_LENGTH == 0) + && (buf != currentBuffer || buf.readableBytes() > acknowledgedBytes)) { + sendResponse(channel); + currentBuffer = buf; + acknowledgedBytes = buf.readableBytes(); } if (buf.readableBytes() >= length) { |