mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-14 12:17:06 +00:00
perf[net]: 优化SignalPacketAttachment的equals和hashcode方法,提升性能并且避免box和unbox
This commit is contained in:
1 parent
374cef9a7e
commit
7fec12b3b9
1 file changed
+2
-3
@@ -16,7 +16,6 @@ package com.zfoo.net.packet.model;
|
||||
import com.zfoo.protocol.IPacket;
|
||||
import com.zfoo.scheduler.util.TimeUtils;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CompletableFuture;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
@@ -94,12 +93,12 @@ public class SignalPacketAttachment implements IPacketAttachment {
|
||||
return false;
|
||||
}
|
||||
SignalPacketAttachment that = (SignalPacketAttachment) o;
|
||||
return Objects.equals(packetId, that.packetId);
|
||||
return packetId == that.packetId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(packetId);
|
||||
return packetId;
|
||||
}
|
||||
|
||||
public int getPacketId() {
|
||||
|
||||
Reference in new issue
Block a user