From 88ae7e2af8bf3159b1a8b05889371a41beb3a3df Mon Sep 17 00:00:00 2001 From: Sankar Cheppali Date: Sat, 26 Aug 2023 13:55:01 +0530 Subject: [PATCH] remove the collector --- src/main/java/redis/clients/jedis/JedisPubSubBase.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main/java/redis/clients/jedis/JedisPubSubBase.java b/src/main/java/redis/clients/jedis/JedisPubSubBase.java index d092d08d5b..b98418829f 100644 --- a/src/main/java/redis/clients/jedis/JedisPubSubBase.java +++ b/src/main/java/redis/clients/jedis/JedisPubSubBase.java @@ -1,11 +1,9 @@ package redis.clients.jedis; -import static java.util.stream.Collectors.*; import static redis.clients.jedis.Protocol.ResponseKeyword.*; import java.util.Arrays; import java.util.List; -import java.util.stream.Collectors; import redis.clients.jedis.Protocol.Command; import redis.clients.jedis.exceptions.JedisException; @@ -138,8 +136,7 @@ private void process() { final T enchannel = (bchannel == null) ? null : encode(bchannel); final Object bmesg = listReply.get(2); if (bmesg instanceof List) { - final List enmesgs = ((List) bmesg).stream().map(this::encode).collect(toList()); - enmesgs.forEach(msg -> onMessage(enchannel, msg)); + ((List) bmesg).stream().map(this::encode).forEach(msg -> onMessage(enchannel, msg)); } else { final T enmesg = (bmesg == null) ? null : encode((byte[]) bmesg); onMessage(enchannel, enmesg);