Skip to content

Commit

Permalink
[LI-HOTFIX] Preallocate maps with exact size instead of the default(w…
Browse files Browse the repository at this point in the history
…hich is 16) (apache#50) (apache#270)

LI_DESCRIPTION =
EXIT_CRITERIA =

(cherry picked from commit d2f66fa)

Co-authored-by: Virupaksha Swamy Uttanur Matada <viswamy@linkedin.com>
  • Loading branch information
2 people authored and lmr3796 committed Feb 9, 2022
1 parent ff1c442 commit ec93cfd
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -55,7 +55,7 @@ public Schema(Field... fs) {
*/
public Schema(boolean tolerateMissingFieldsWithDefaults, Field... fs) {
this.fields = new BoundField[fs.length];
this.fieldsByName = new HashMap<>();
this.fieldsByName = new HashMap<>(fs.length);
this.tolerateMissingFieldsWithDefaults = tolerateMissingFieldsWithDefaults;
for (int i = 0; i < this.fields.length; i++) {
Field def = fs[i];
Expand Down

0 comments on commit ec93cfd

Please sign in to comment.