Skip to content

Commit

Permalink
[misc] result-set array grown small improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Sep 1, 2022
1 parent 8765f31 commit e697ef3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/java/org/mariadb/jdbc/client/result/Result.java
Expand Up @@ -13,7 +13,6 @@
import java.net.MalformedURLException;
import java.net.URL;
import java.sql.*;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Map;
import java.util.concurrent.locks.ReentrantLock;
Expand Down Expand Up @@ -248,7 +247,9 @@ protected void skipRemaining() throws IOException, SQLException {
/** Grow data array. */
private void growDataArray() {
int newCapacity = data.length + (data.length >> 1);
data = Arrays.copyOf(data, newCapacity);
byte[][] newData = new byte[newCapacity][];
System.arraycopy(data, 0, newData, 0, data.length);
data = newData;
}

/**
Expand Down

0 comments on commit e697ef3

Please sign in to comment.