From f8f21ce131556ca5c1ea44ede496ace9d810c844 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Wed, 6 Jul 2016 16:52:23 +0500 Subject: More optimizations --- src/org/traccar/protocol/GranitProtocol.java | 2 +- src/org/traccar/protocol/GranitProtocolDecoder.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/protocol/GranitProtocol.java b/src/org/traccar/protocol/GranitProtocol.java index 07357b786..a33c43d20 100644 --- a/src/org/traccar/protocol/GranitProtocol.java +++ b/src/org/traccar/protocol/GranitProtocol.java @@ -40,7 +40,7 @@ public class GranitProtocol extends BaseProtocol { TrackerServer server = new TrackerServer(new ServerBootstrap(), this.getName()) { @Override protected void addSpecificHandlers(ChannelPipeline pipeline) { - pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024, true, false)); + pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1024)); pipeline.addLast("objectEncoder", new GranitProtocolEncoder()); pipeline.addLast("objectDecoder", new GranitProtocolDecoder(GranitProtocol.this)); } diff --git a/src/org/traccar/protocol/GranitProtocolDecoder.java b/src/org/traccar/protocol/GranitProtocolDecoder.java index c919b3d65..b92bc72e2 100644 --- a/src/org/traccar/protocol/GranitProtocolDecoder.java +++ b/src/org/traccar/protocol/GranitProtocolDecoder.java @@ -81,8 +81,8 @@ public class GranitProtocolDecoder extends BaseProtocolDecoder { int latDegrees = buf.readUnsignedByte(); int lonMinutes = buf.readUnsignedShort(); int latMinutes = buf.readUnsignedShort(); - double latitude = latDegrees + (double) latMinutes / 60000; - double longitude = lonDegrees + (double) lonMinutes / 60000; + double latitude = latDegrees + latMinutes / 60000.0; + double longitude = lonDegrees + lonMinutes / 60000.0; if (!BitUtil.check(flags, 4)) { latitude = -latDegrees; } -- cgit v1.2.3