refactor: 优化部分代码

修复 Sonar 扫描问题
This commit is contained in:
2024-01-27 14:33:15 +08:00
parent 9c0cd2fd9d
commit fe0bff3d3e
13 changed files with 56 additions and 44 deletions

View File

@@ -24,7 +24,6 @@ import top.charles7c.continew.starter.core.constant.StringConstants;
import java.time.Duration;
import java.util.Collection;
import java.util.stream.Collectors;
import java.util.stream.Stream;
/**
@@ -138,7 +137,7 @@ public class RedisUtils {
*/
public static Collection<String> keys(final String keyPattern) {
Stream<String> stream = CLIENT.getKeys().getKeysStreamByPattern(getNameMapper().map(keyPattern));
return stream.map(key -> getNameMapper().unmap(key)).collect(Collectors.toList());
return stream.map(key -> getNameMapper().unmap(key)).toList();
}
/**