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);