mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Minor code change: optimization.
This commit is contained in:
@@ -685,6 +685,21 @@ public class ArrayUtil extends ArrayUtilRt {
|
||||
return indexOf(objects, o) >= 0;
|
||||
}
|
||||
|
||||
public static boolean contains(@Nullable final String s, final String... strings) {
|
||||
if (s == null) {
|
||||
for (String str : strings) {
|
||||
if (str == null) return true;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (String str : strings) {
|
||||
if (s.equals(str)) return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static int[] newIntArray(int count) {
|
||||
return count == 0 ? EMPTY_INT_ARRAY : new int[count];
|
||||
|
||||
Reference in New Issue
Block a user