From 6ff91809879f7f128842f50cc9c73dc0a5982c49 Mon Sep 17 00:00:00 2001 From: Luck Date: Tue, 4 Dec 2018 00:03:47 +0000 Subject: [PATCH] Remove redundant extra lambda in EventManager#fire implementation --- .../proxy/plugin/VelocityEventManager.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java b/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java index 7526a50a2..4cfa88de0 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/plugin/VelocityEventManager.java @@ -110,7 +110,8 @@ public class VelocityEventManager implements EventManager { return CompletableFuture.completedFuture(event); } - Runnable runEvent = () -> { + CompletableFuture eventFuture = new CompletableFuture<>(); + service.execute(() -> { PostResult result = bus.post(event); if (!result.exceptions().isEmpty()) { logger.error("Some errors occurred whilst posting event {}.", event); @@ -119,11 +120,6 @@ public class VelocityEventManager implements EventManager { logger.error("#{}: \n", ++i, exception); } } - }; - - CompletableFuture eventFuture = new CompletableFuture<>(); - service.execute(() -> { - runEvent.run(); eventFuture.complete(event); }); return eventFuture;