优化 toArray 预设大小的数组替换为零长度数组
This commit is contained in:
@@ -41,7 +41,7 @@ public class PostListType implements FieldType {
|
||||
}
|
||||
}
|
||||
}
|
||||
return list.size() > 0 ? list.toArray(new String[list.size()]) : null;
|
||||
return !list.isEmpty() ? list.toArray(new String[0]) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -41,7 +41,7 @@ public class RoleListType implements FieldType {
|
||||
}
|
||||
}
|
||||
}
|
||||
return list.size() > 0 ? list.toArray(new String[list.size()]) : null;
|
||||
return !list.isEmpty() ? list.toArray(new String[0]) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -263,7 +263,7 @@ public class EmpUtils {
|
||||
}
|
||||
}
|
||||
});
|
||||
return list.toArray(new String[list.size()]);
|
||||
return list.toArray(new String[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user