浏览代码

优化字符串工具

Huanyi 1 月之前
父节点
当前提交
1cc9c84c26

+ 1 - 6
ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/utils/StringUtils.java

@@ -404,12 +404,7 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
             return "";
         }
 
-        List<String> pool;
-        if (chars == null || chars.isEmpty()) {
-            pool = DEFAULT_CHARS;
-        } else {
-            pool = chars;
-        }
+        List<String> pool = chars == null || chars.isEmpty() ? DEFAULT_CHARS : chars;
         if (pool.isEmpty()) {
             throw new IllegalArgumentException("字符集不能为空");
         }