3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-11-04 23:30:24 +01:00

Improve performance in ProtocolVersionRange#contains (#3964)

Dieser Commit ist enthalten in:
EnZaXD 2024-06-22 11:02:16 +02:00 committet von GitHub
Ursprung b67ebecce8
Commit 9d3db4cf97
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -104,7 +104,10 @@ public class ProtocolVersionRange {
*/ */
public boolean contains(final ProtocolVersion version) { public boolean contains(final ProtocolVersion version) {
if (this.ranges == null) return true; if (this.ranges == null) return true;
return this.ranges.stream().anyMatch(range -> range.contains(version)); for (Range<ProtocolVersion> range : this.ranges) {
if (range.contains(version)) return true;
}
return false;
} }
@Override @Override