mirror of
https://github.com/ViaVersion/ViaLoader.git
synced 2025-02-22 02:31:46 +01:00
Greatly improved performance when checking VersionRanges
This commit is contained in:
parent
4279e089b7
commit
02044a0511
@ -61,7 +61,9 @@ public class VersionRange {
|
||||
}
|
||||
|
||||
public boolean contains(final ProtocolVersion version) {
|
||||
if (this.ranges.stream().anyMatch(range -> range.contains(version))) return true;
|
||||
for (VersionRange range : this.ranges) {
|
||||
if (range.contains(version)) return true;
|
||||
}
|
||||
if (this.min == null && this.max == null) return true;
|
||||
else if (this.min == null) return version.olderThanOrEqualTo(this.max);
|
||||
else if (this.max == null) return version.newerThanOrEqualTo(this.min);
|
||||
|
Loading…
Reference in New Issue
Block a user