File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
x-pack/plugin/esql/compute/src/main/java/org/elasticsearch/compute/data Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 1111import org .elasticsearch .TransportVersions ;
1212import org .elasticsearch .common .io .stream .StreamInput ;
1313import org .elasticsearch .common .io .stream .StreamOutput ;
14- import org .elasticsearch .common .util .Maps ;
1514
1615import java .io .IOException ;
16+ import java .util .Arrays ;
1717import java .util .Map ;
18+ import java .util .function .Function ;
19+ import java .util .stream .Collectors ;
1820
1921/**
2022 * The type of elements in {@link Block} and {@link Vector}
@@ -110,11 +112,10 @@ public String pascalCaseName() {
110112
111113 static {
112114 ElementType [] values = values ();
113- fromLegacyNames = Maps .newMapWithExpectedSize (values .length );
114115 for (int i = 0 ; i < values .length ; i ++) {
115116 assert values [i ].writableCode == i ;
116- fromLegacyNames .put (values [i ].legacyWritableName , values [i ]);
117117 }
118+ fromLegacyNames = Arrays .stream (values ).collect (Collectors .toUnmodifiableMap (e -> e .legacyWritableName , Function .identity ()));
118119 }
119120
120121 /**
You can’t perform that action at this time.
0 commit comments