From c2a9b55fb02690d0cde4bb930e2dcbd1dec90729 Mon Sep 17 00:00:00 2001 From: jaysunxiao Date: Sun, 20 Feb 2022 12:08:35 +0800 Subject: [PATCH] =?UTF-8?q?perf[protocol]:=20=E7=AE=80=E5=8C=96ArrayUtils?= =?UTF-8?q?=E5=AF=B9=E4=BA=8E=E6=95=B0=E7=BB=84=E4=B8=BA=E7=A9=BA=E7=9A=84?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../zfoo/protocol/collection/ArrayUtils.java | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/protocol/src/main/java/com/zfoo/protocol/collection/ArrayUtils.java b/protocol/src/main/java/com/zfoo/protocol/collection/ArrayUtils.java index b83dab72..8d50cd9b 100644 --- a/protocol/src/main/java/com/zfoo/protocol/collection/ArrayUtils.java +++ b/protocol/src/main/java/com/zfoo/protocol/collection/ArrayUtils.java @@ -158,7 +158,7 @@ public abstract class ArrayUtils { * toList */ public static List toList(boolean[] array) { - if (array == null || array.length == 0) { + if (isEmpty(array)) { return Collections.emptyList(); } var list = new ArrayList(); @@ -169,7 +169,7 @@ public abstract class ArrayUtils { } public static List toList(byte[] array) { - if (array == null || array.length == 0) { + if (isEmpty(array)) { return Collections.emptyList(); } var list = new ArrayList(); @@ -180,7 +180,7 @@ public abstract class ArrayUtils { } public static List toList(short[] array) { - if (array == null || array.length == 0) { + if (isEmpty(array)) { return Collections.emptyList(); } var list = new ArrayList(); @@ -191,7 +191,7 @@ public abstract class ArrayUtils { } public static List toList(int[] array) { - if (array == null || array.length == 0) { + if (isEmpty(array)) { return Collections.emptyList(); } var list = new ArrayList(); @@ -202,7 +202,7 @@ public abstract class ArrayUtils { } public static List toList(long[] array) { - if (array == null || array.length == 0) { + if (isEmpty(array)) { return Collections.emptyList(); } var list = new ArrayList(); @@ -213,7 +213,7 @@ public abstract class ArrayUtils { } public static List toList(float[] array) { - if (array == null || array.length == 0) { + if (isEmpty(array)) { return Collections.emptyList(); } var list = new ArrayList(); @@ -224,7 +224,7 @@ public abstract class ArrayUtils { } public static List toList(double[] array) { - if (array == null || array.length == 0) { + if (isEmpty(array)) { return Collections.emptyList(); } var list = new ArrayList(); @@ -235,7 +235,7 @@ public abstract class ArrayUtils { } public static List toList(char[] array) { - if (array == null || array.length == 0) { + if (isEmpty(array)) { return Collections.emptyList(); } var list = new ArrayList(); @@ -246,7 +246,7 @@ public abstract class ArrayUtils { } public static List toList(T[] array) { - if (ArrayUtils.isEmpty(array)) { + if (isEmpty(array)) { return Collections.emptyList(); } return Arrays.asList(array);