mirror of
https://github.com/Xiao-MoMi/craft-engine.git
synced 2026-01-06 15:52:03 +00:00
refactor(core): 优化 FriendlyByteBuf 类中的 long 数组读取方法
- 修改 readLongArray 方法的参数声明,提高代码可读性 - 保持功能和逻辑不变,仅调整参数类型标注
This commit is contained in:
@@ -221,11 +221,11 @@ public class FriendlyByteBuf extends ByteBuf {
|
|||||||
return this.readLongArray(null);
|
return this.readLongArray(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long[] readLongArray(@Nullable long[] toArray) {
|
public long[] readLongArray(long @Nullable [] toArray) {
|
||||||
return this.readLongArray(toArray, this.readableBytes() / 8);
|
return this.readLongArray(toArray, this.readableBytes() / 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
public long[] readLongArray(@Nullable long[] toArray, int maxSize) {
|
public long[] readLongArray(long @Nullable [] toArray, int maxSize) {
|
||||||
int arraySize = this.readVarInt();
|
int arraySize = this.readVarInt();
|
||||||
if (toArray == null || toArray.length != arraySize) {
|
if (toArray == null || toArray.length != arraySize) {
|
||||||
if (arraySize > maxSize) {
|
if (arraySize > maxSize) {
|
||||||
|
|||||||
Reference in New Issue
Block a user