From f4f71c713e4854a4d730fd21f3926b2186376143 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 4 Sep 2024 13:47:10 +0200 Subject: [PATCH] =?utf8?q?=F0=9F=90=9B=20Only=20evaluate=20the=20message?= =?utf8?q?=20function=20once?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java b/src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java index cf0ddd2..3d9a660 100644 --- a/src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/highlevel/FcpClientTest.java @@ -204,7 +204,8 @@ public class FcpClientTest { @Override public void sendMessage(FcpMessage fcpMessage) { - listeners.forEach(listener -> messageConsumer.apply(fcpMessage).accept(listener, this)); + BiConsumer listenerNotifier = messageConsumer.apply(fcpMessage); + listeners.forEach(listener -> listenerNotifier.accept(listener, this)); } }; } -- 2.7.4