GabrielOlvH / Industrial-Revolution

An Industrial mod made for Fabric.
Apache License 2.0
193 stars 56 forks source link

use EnumSet in MachineBlockEntity for valid connection directions #483

Open dfsek opened 1 year ago

dfsek commented 1 year ago

Currently, MachineBlockEntity#validConnections uses an ArrayList for storing connection directions, this is significantly slower than using EnumSet, for contains operations. this performance difference manifests when large networks transfer energy. No accesses of this value rely on order of elements, so changing the collection implementation used produces no differences in behavior.