Skip to content

Commit

Permalink
[NAVAND-2844] Improve array creation while parsing (#1582)
Browse files Browse the repository at this point in the history
  • Loading branch information
holuss authored May 21, 2024
1 parent 59cc2cf commit 9bd9b7f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected List<Double> readPointList(JsonReader in) throws IOException {
throw new NullPointerException();
}

List<Double> coordinates = new ArrayList<Double>();
List<Double> coordinates = new ArrayList<Double>(3);
in.beginArray();
while (in.hasNext()) {
coordinates.add(in.nextDouble());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public void write(JsonWriter out, BoundingBox value) throws IOException {
@Override
public BoundingBox read(JsonReader in) throws IOException {

List<Double> rawCoordinates = new ArrayList<Double>();
List<Double> rawCoordinates = new ArrayList<Double>(6);
in.beginArray();
while (in.hasNext()) {
rawCoordinates.add(in.nextDouble());
Expand Down

0 comments on commit 9bd9b7f

Please sign in to comment.