1
0
mirror of https://github.com/lucko/LuckPerms.git synced 2025-09-08 21:30:55 +02:00

Micro-optimize temporary node audit (#4155)

This commit is contained in:
Luck
2025-08-23 15:39:49 +01:00
parent 73d710a89e
commit 65c42b9b09
2 changed files with 3 additions and 3 deletions

View File

@@ -231,11 +231,11 @@ public final class EventDispatcher {
}
public void dispatchNodeChanges(PermissionHolder target, DataType dataType, Difference<Node> changes) {
if (!this.eventBus.shouldPost(NodeAddEvent.class) && !this.eventBus.shouldPost(NodeRemoveEvent.class)) {
if (changes.isEmpty()) {
return;
}
if (changes.isEmpty()) {
if (!this.eventBus.shouldPost(NodeAddEvent.class) && !this.eventBus.shouldPost(NodeRemoveEvent.class)) {
return;
}

View File

@@ -431,8 +431,8 @@ public abstract class PermissionHolder {
Difference<Node> result = getData(dataType).removeIf(Node::hasExpired);
if (!result.isEmpty()) {
invalidateCache();
this.plugin.getEventDispatcher().dispatchNodeChanges(this, dataType, result);
}
this.plugin.getEventDispatcher().dispatchNodeChanges(this, dataType, result);
return !result.isEmpty();
}