From: David ‘Bombe’ Roden Date: Wed, 4 Sep 2024 11:47:10 +0000 (+0200) Subject: 🐛 Only evaluate the message function once X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=f4f71c713e4854a4d730fd21f3926b2186376143;p=jFCPlib.git 🐛 Only evaluate the message function once --- 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)); } }; }