Skip to content

Commit

Permalink
Skip array sort when the length of array not greater than 1
Browse files Browse the repository at this point in the history
Closes gh-30934
  • Loading branch information
remeio authored and sbrannen committed Aug 4, 2023
1 parent da7b68a commit 07a1aea
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -1472,7 +1472,7 @@ else if (type.isArray()) {
}
TypeConverter converter = (typeConverter != null ? typeConverter : getTypeConverter());
Object result = converter.convertIfNecessary(matchingBeans.values(), resolvedArrayType);
if (result instanceof Object[] array) {
if (result instanceof Object[] array && array.length > 1) {
Comparator<Object> comparator = adaptDependencyComparator(matchingBeans);
if (comparator != null) {
Arrays.sort(array, comparator);
Expand Down

0 comments on commit 07a1aea

Please sign in to comment.