Skip to content

Commit 0c7bfea

Browse files
sazzad16mina-asham
andauthored
use method reference and avoid parallel stream
From @mina-asham, I would avoid `parallelStream` here: 1. I don't really think it's that intensive of an operation that you are going to get a gain 2. It's going to use the shared forkjoin pool and might affect other operations Also we can use the method reference for the map operation. Co-authored-by: Mina Asham <mina.asham@hotmail.com>
1 parent a30e163 commit 0c7bfea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/redis/clients/jedis/JedisSentinelPool.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ public JedisSentinelPool(String masterName, Set<HostAndPort> sentinels,
170170
}
171171

172172
private static Set<HostAndPort> parseHostAndPorts(Set<String> strings) {
173-
return strings.parallelStream().map(str -> HostAndPort.parseString(str)).collect(Collectors.toSet());
173+
return strings.stream().map(HostAndPort::parseString).collect(Collectors.toSet());
174174
}
175175

176176
@Override

0 commit comments

Comments
 (0)