Micro-optimize temporary node audit (#4155)

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

No files matched your search

@@ -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;
}
@@ -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();
}