This is an automated email from the ASF dual-hosted git repository.
clesaec pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro.git
The following commit(s) were added to refs/heads/main by this push:
new 6f6cc60b5 Removed redundant casts from DirectBinaryDecoder (#2563)
6f6cc60b5 is described below
commit 6f6cc60b5161476fd5635aaaa6f32421cb90a496
Author: Ash <[email protected]>
AuthorDate: Tue Oct 24 01:06:43 2023 -0700
Removed redundant casts from DirectBinaryDecoder (#2563)
thanks to @mystic-lama for this improvement
---
.../src/main/java/org/apache/avro/io/DirectBinaryDecoder.java | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git
a/lang/java/avro/src/main/java/org/apache/avro/io/DirectBinaryDecoder.java
b/lang/java/avro/src/main/java/org/apache/avro/io/DirectBinaryDecoder.java
index 6f07b13ee..71f3ed593 100644
--- a/lang/java/avro/src/main/java/org/apache/avro/io/DirectBinaryDecoder.java
+++ b/lang/java/avro/src/main/java/org/apache/avro/io/DirectBinaryDecoder.java
@@ -45,10 +45,10 @@ class DirectBinaryDecoder extends BinaryDecoder {
result = old;
result.clear();
} else {
- result = ByteBuffer.allocate((int) length);
+ result = ByteBuffer.allocate(length);
}
- doReadBytes(result.array(), result.position(), (int) length);
- result.limit((int) length);
+ doReadBytes(result.array(), result.position(), length);
+ result.limit(length);
return result;
}
}
@@ -65,7 +65,7 @@ class DirectBinaryDecoder extends BinaryDecoder {
if (old != null) {
return super.read(old, length);
} else {
- return bbi.readBuffer((int) length);
+ return bbi.readBuffer(length);
}
}
}