HHH-10301 Don't allocate a new List if it is not required
This commit is contained in:
parent
2e8d52e654
commit
f4e58d342d
|
@ -211,6 +211,10 @@ public class HQLQueryPlan implements Serializable {
|
||||||
queryParametersToUse = queryParameters;
|
queryParametersToUse = queryParameters;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//fast path to avoid unnecessary allocation and copying
|
||||||
|
if ( translators.length == 1 ) {
|
||||||
|
return translators[0].list( session, queryParametersToUse );
|
||||||
|
}
|
||||||
final int guessedResultSize = guessResultSize( rowSelection );
|
final int guessedResultSize = guessResultSize( rowSelection );
|
||||||
final List combinedResults = new ArrayList( guessedResultSize );
|
final List combinedResults = new ArrayList( guessedResultSize );
|
||||||
final IdentitySet distinction;
|
final IdentitySet distinction;
|
||||||
|
|
Loading…
Reference in New Issue