3
0
Mirror von https://github.com/PaperMC/Velocity.git synchronisiert 2024-11-17 05:20:14 +01:00

Presize the maps.

TODO: Replace that ugly autoboxed primitive without excessively blowing
up the size of the JAR
Dieser Commit ist enthalten in:
Andrew Steinborn 2018-08-10 20:56:22 -04:00
Ursprung 738be8d535
Commit 8998bc7c8f

Datei anzeigen

@ -167,7 +167,7 @@ public enum StateRegistry {
private final ProtocolConstants.Direction direction;
private final StateRegistry state;
private final IntObjectMap<ProtocolVersion> versions = new IntObjectHashMap<>();
private final IntObjectMap<ProtocolVersion> versions = new IntObjectHashMap<>(16);
public PacketRegistry(Direction direction, StateRegistry state) {
this.direction = direction;
@ -216,8 +216,8 @@ public enum StateRegistry {
public class ProtocolVersion {
public final int id;
final IntObjectMap<Supplier<? extends MinecraftPacket>> packetIdToSupplier = new IntObjectHashMap<>();
final Map<Class<? extends MinecraftPacket>, Integer> packetClassToId = new HashMap<>();
final IntObjectMap<Supplier<? extends MinecraftPacket>> packetIdToSupplier = new IntObjectHashMap<>(16, 0.5f);
final Map<Class<? extends MinecraftPacket>, Integer> packetClassToId = new HashMap<>(16, 0.5f);
ProtocolVersion(final int id) {
this.id = id;