From 1bdb389eaefc4bbd5c5944c3cb8d7985cfae30e9 Mon Sep 17 00:00:00 2001 From: "Nelson A. de Oliveira" Date: Wed, 31 Jul 2013 15:14:11 -0300 Subject: [PATCH] Fix pointless aithmetic expressions --- .../com/google/protobuf/DescriptorProtos.java | 2 +- .../src/net/osmand/binary/OsmandOdb.java | 20 +++++++++---------- .../src/net/osmand/util/Algorithms.java | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/OsmAnd-java/src/com/google/protobuf/DescriptorProtos.java b/OsmAnd-java/src/com/google/protobuf/DescriptorProtos.java index fcaea4368a..42abe80ced 100644 --- a/OsmAnd-java/src/com/google/protobuf/DescriptorProtos.java +++ b/OsmAnd-java/src/com/google/protobuf/DescriptorProtos.java @@ -545,7 +545,7 @@ public final class DescriptorProtos { .computeStringSizeNoTag(element); } size += dataSize; - size += 1 * getDependencyList().size(); + size += getDependencyList().size(); } for (com.google.protobuf.DescriptorProtos.DescriptorProto element : getMessageTypeList()) { size += com.google.protobuf.CodedOutputStream diff --git a/OsmAnd-java/src/net/osmand/binary/OsmandOdb.java b/OsmAnd-java/src/net/osmand/binary/OsmandOdb.java index 1b20c77ce9..df8a691cf6 100644 --- a/OsmAnd-java/src/net/osmand/binary/OsmandOdb.java +++ b/OsmAnd-java/src/net/osmand/binary/OsmandOdb.java @@ -1329,7 +1329,7 @@ public final class OsmandOdb { .computeStringSizeNoTag(element); } size += dataSize; - size += 1 * getSList().size(); + size += getSList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -1713,13 +1713,13 @@ public final class OsmandOdb { .computeStringSizeNoTag(element); } size += dataSize; - size += 1 * getKeyList().size(); + size += getKeyList().size(); } { int dataSize = 0; dataSize = 4 * getValList().size(); size += dataSize; - size += 1 * getValList().size(); + size += getValList().size(); } for (net.osmand.binary.OsmandOdb.IndexedStringTable element : getSubtablesList()) { size += com.google.protobuf.CodedOutputStream @@ -4965,7 +4965,7 @@ public final class OsmandOdb { .computeBytesSizeNoTag(element); } size += dataSize; - size += 1 * getPolygonInnerCoordinatesList().size(); + size += getPolygonInnerCoordinatesList().size(); } if (hasAdditionalTypes()) { size += com.google.protobuf.CodedOutputStream @@ -7393,7 +7393,7 @@ public final class OsmandOdb { .computeInt32SizeNoTag(element); } size += dataSize; - size += 1 * getShiftToIndexList().size(); + size += getShiftToIndexList().size(); } { int dataSize = 0; @@ -7402,7 +7402,7 @@ public final class OsmandOdb { .computeInt32SizeNoTag(element); } size += dataSize; - size += 1 * getShiftToCityIndexList().size(); + size += getShiftToCityIndexList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -15798,7 +15798,7 @@ public final class OsmandOdb { .computeStringSizeNoTag(element); } size += dataSize; - size += 1 * getSubcategoriesList().size(); + size += getSubcategoriesList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -16740,7 +16740,7 @@ public final class OsmandOdb { .computeUInt32SizeNoTag(element); } size += dataSize; - size += 1 * getCategoriesList().size(); + size += getCategoriesList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; @@ -17651,7 +17651,7 @@ public final class OsmandOdb { .computeUInt32SizeNoTag(element); } size += dataSize; - size += 1 * getCategoriesList().size(); + size += getCategoriesList().size(); } if (hasName()) { size += com.google.protobuf.CodedOutputStream @@ -18265,7 +18265,7 @@ public final class OsmandOdb { .computeSInt64SizeNoTag(element); } size += dataSize; - size += 1 * getRouteIdList().size(); + size += getRouteIdList().size(); } size += getUnknownFields().getSerializedSize(); memoizedSerializedSize = size; diff --git a/OsmAnd-java/src/net/osmand/util/Algorithms.java b/OsmAnd-java/src/net/osmand/util/Algorithms.java index bc4ed5b77b..f8a4f84260 100644 --- a/OsmAnd-java/src/net/osmand/util/Algorithms.java +++ b/OsmAnd-java/src/net/osmand/util/Algorithms.java @@ -162,7 +162,7 @@ public class Algorithms { o = o << 8 | (0xff & bytes[offset + 3]); o = o << 8 | (0xff & bytes[offset + 2]); o = o << 8 | (0xff & bytes[offset + 1]); - o = o << 8 | (0xff & bytes[offset + 0]); + o = o << 8 | (0xff & bytes[offset]); return o; } @@ -191,7 +191,7 @@ public class Algorithms { int o = (0xff & bytes[offset + 3]) << 24; o |= (0xff & bytes[offset + 2]) << 16; o |= (0xff & bytes[offset + 1]) << 8; - o |= (0xff & bytes[offset + 0]); + o |= (0xff & bytes[offset]); return o; } @@ -244,7 +244,7 @@ public class Algorithms { public static int parseSmallIntFromBytes(byte[] bytes, int offset) { int s = (0xff & bytes[offset + 1]) << 8; - s |= (0xff & bytes[offset + 0]); + s |= (0xff & bytes[offset]); return s; }