Github user mayya-sharipova commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/320#discussion_r167653245
--- Diff: lucene/core/src/java/org/apache/lucene/index/FieldInfos.java ---
@@ -63,21 +62,30 @@ public FieldInfos(FieldInfo[] infos) {
boolean hasNorms = false;
boolean hasDocValues = false;
boolean hasPointValues = false;
-
- TreeMap<Integer, FieldInfo> byNumber = new TreeMap<>();
+
+ int size = 0; // number of elements in byNumberTemp
+ int capacity = 10; // byNumberTemp's capacity
--- End diff --
@jpountz Thank you for the suggestion on `capacity` - very nice one. For
the `size`, later we use this variable to create the final array: `byNumber =
new FieldInfo[size]`. We can also do: `byNumber = new
FieldInfo[byNumberTemp.length]`, but then `byNumber` may have some empty slots.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]