Skip to content

Commit

Permalink
eliminate some warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
esaulpaugh committed Oct 13, 2019
1 parent 9e3daa5 commit 7c56702
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/esaulpaugh/headlong/abi/PackedDecoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private static Tuple decodeTopTuple(TupleType tupleType, byte[] buffer, int end)
case TYPE_CODE_BIG_INTEGER: idx -= type.byteLengthPacked(null); end = idx; decodeBigInteger((BigIntegerType) type, buffer, idx, elements, i); break;
case TYPE_CODE_BIG_DECIMAL: idx -= type.byteLengthPacked(null); end = idx; decodeBigDecimal((BigDecimalType) type, buffer, idx, elements, i); break;
case TYPE_CODE_ARRAY: {
final ArrayType<? extends ABIType<?>, ?> arrayType = (ArrayType<? extends ABIType<?>, ?>) type;
final ArrayType<? extends ABIType<?>, ?> arrayType = (ArrayType<?, ?>) type;
end = idx = idx - (arrayType.elementType.byteLengthPacked(null) * arrayType.length);
idx -= decodeArrayDynamic(arrayType, buffer, idx, end, elements, i);
break;
Expand All @@ -92,7 +92,7 @@ private static Tuple decodeTopTuple(TupleType tupleType, byte[] buffer, int end)
case TYPE_CODE_LONG: idx += decodeLong((LongType) type, buffer, idx, elements, i); break;
case TYPE_CODE_BIG_INTEGER: idx += decodeBigInteger((BigIntegerType) type, buffer, idx, elements, i); break;
case TYPE_CODE_BIG_DECIMAL: idx += decodeBigDecimal((BigDecimalType) type, buffer, idx, elements, i); break;
case TYPE_CODE_ARRAY: idx += decodeArrayDynamic((ArrayType<? extends ABIType<?>, ?>) type, buffer, idx, end, elements, i); break;
case TYPE_CODE_ARRAY: idx += decodeArrayDynamic((ArrayType<?, ?>) type, buffer, idx, end, elements, i); break;
case TYPE_CODE_TUPLE: throw new UnsupportedOperationException("nested tuple"); // idx += decodeTupleDynamic((TupleType) type, buffer, idx, end, elements, i); break;
}
}
Expand All @@ -118,7 +118,7 @@ private static Tuple decodeTupleStatic(TupleType tupleType, byte[] buffer) {
case TYPE_CODE_LONG: idx += decodeLong((LongType) type, buffer, idx, elements, i); break;
case TYPE_CODE_BIG_INTEGER: idx += decodeBigInteger((BigIntegerType) type, buffer, idx, elements, i); break;
case TYPE_CODE_BIG_DECIMAL: idx += decodeBigDecimal((BigDecimalType) type, buffer, idx, elements, i); break;
case TYPE_CODE_ARRAY: idx += decodeArrayDynamic((ArrayType<? extends ABIType<?>, ?>) type, buffer, idx, end, elements, i); break;
case TYPE_CODE_ARRAY: idx += decodeArrayDynamic((ArrayType<?, ?>) type, buffer, idx, end, elements, i); break;
case TYPE_CODE_TUPLE: throw new UnsupportedOperationException("nested tuple"); // idx += decodeTupleDynamic((TupleType) type, buffer, idx, end, elements, i); break;
}
}
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/com/esaulpaugh/headlong/rlp/RLPItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -232,10 +232,8 @@ public BigDecimal asBigDecimal(int scale) {
@Override
public final int hashCode() {
int result = 1;
final byte[] buf = buffer;
final int end = endIndex;
for (int i = index; i < end; i++) {
result = 31 * result + buf[i];
for (int i = index; i < endIndex; i++) {
result = 31 * result + buffer[i];
}
return result;
}
Expand Down

0 comments on commit 7c56702

Please sign in to comment.