#3099: Improve toArray calls by using an empty array as parameter.
From Intellij IDEA inspections: Since late updates of OpenJDK 6 this call was intrinsified, making the performance of the empty array version the same and sometimes even better, compared to the pre-sized version.
This commit is contained in:
@@ -115,7 +115,7 @@ public final class ChatComponentTransformer
|
||||
{
|
||||
if ( root.getExtra() != null && !root.getExtra().isEmpty() )
|
||||
{
|
||||
List<BaseComponent> list = Lists.newArrayList( transform( player, transformHover, root.getExtra().toArray( new BaseComponent[ root.getExtra().size() ] ) ) );
|
||||
List<BaseComponent> list = Lists.newArrayList( transform( player, transformHover, root.getExtra().toArray( new BaseComponent[ 0 ] ) ) );
|
||||
root.setExtra( list );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user