mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-01 08:10:00 +01:00
Improve performance in ProtocolVersionRange#contains (#3964)
This commit is contained in:
parent
b67ebecce8
commit
9d3db4cf97
@ -104,7 +104,10 @@ public class ProtocolVersionRange {
|
||||
*/
|
||||
public boolean contains(final ProtocolVersion version) {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user