mirror of
https://github.com/lucko/LuckPerms.git
synced 2025-09-03 11:22:33 +02:00
Micro-optimise some frequently iterated lists
This commit is contained in:
@@ -25,8 +25,6 @@
|
||||
|
||||
package me.lucko.luckperms.velocity.calculator;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
|
||||
import me.lucko.luckperms.common.cacheddata.CacheMetadata;
|
||||
import me.lucko.luckperms.common.calculator.CalculatorFactory;
|
||||
import me.lucko.luckperms.common.calculator.PermissionCalculator;
|
||||
@@ -40,6 +38,9 @@ import me.lucko.luckperms.velocity.LPVelocityPlugin;
|
||||
|
||||
import net.luckperms.api.query.QueryOptions;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class VelocityCalculatorFactory implements CalculatorFactory {
|
||||
private final LPVelocityPlugin plugin;
|
||||
|
||||
@@ -49,7 +50,7 @@ public class VelocityCalculatorFactory implements CalculatorFactory {
|
||||
|
||||
@Override
|
||||
public PermissionCalculator build(QueryOptions queryOptions, CacheMetadata metadata) {
|
||||
ImmutableList.Builder<PermissionProcessor> processors = ImmutableList.builder();
|
||||
List<PermissionProcessor> processors = new ArrayList<>(4);
|
||||
|
||||
processors.add(new DirectProcessor());
|
||||
|
||||
@@ -65,6 +66,6 @@ public class VelocityCalculatorFactory implements CalculatorFactory {
|
||||
processors.add(new SpongeWildcardProcessor());
|
||||
}
|
||||
|
||||
return new PermissionCalculator(this.plugin, metadata, processors.build());
|
||||
return new PermissionCalculator(this.plugin, metadata, processors);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user