mirror of
https://gitee.com/dromara/hutool.git
synced 2025-05-08 06:37:58 +08:00
提升 isAllEmpty方法执行效率
This commit is contained in:
parent
ce504c2a3e
commit
94d3a40e14
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user