mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
提升 isAllEmpty方法执行效率
This commit is contained in:
@@ -1540,7 +1540,12 @@ public class ArrayUtil extends PrimitiveArrayUtil {
|
|||||||
* @since 4.5.18
|
* @since 4.5.18
|
||||||
*/
|
*/
|
||||||
public static boolean isAllEmpty(Object... args) {
|
public static boolean isAllEmpty(Object... args) {
|
||||||
return emptyCount(args) == args.length;
|
for (Object obj: args) {
|
||||||
|
if (!ObjectUtil.isEmpty(obj)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1551,7 +1556,12 @@ public class ArrayUtil extends PrimitiveArrayUtil {
|
|||||||
* @since 4.5.18
|
* @since 4.5.18
|
||||||
*/
|
*/
|
||||||
public static boolean isAllNotEmpty(Object... args) {
|
public static boolean isAllNotEmpty(Object... args) {
|
||||||
return false == hasEmpty(args);
|
for (Object obj: args) {
|
||||||
|
if (ObjectUtil.isEmpty(obj)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user