slow-J commented on code in PR #13489:
URL: https://github.com/apache/lucene/pull/13489#discussion_r1640936281
##########
lucene/facet/src/test/org/apache/lucene/facet/taxonomy/TestTaxonomyFacetValueSource.java:
##########
@@ -694,7 +694,7 @@ private void checkResults(
"dim" + i,
new String[0],
aggregatedValue,
- labelValues.toArray(new LabelAndValue[labelValues.size()]),
+ labelValues.toArray(new LabelAndValue[0]),
Review Comment:
We use the `labelValues.toArray(new LabelAndValue[0])` version in other
tests as well as source code. I read a little online and this blog post is
recommending the `labelValues.toArray(new LabelAndValue[0])` version due to
optimizations in the JVM and JIT, making it more performant than the previous
version:
https://shipilev.net/blog/2016/arrays-wisdom-ancients/#_new_reflective_array
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]