Skip to content

Commit

Permalink
[misc] better variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
rusher committed Dec 30, 2019
1 parent e56a115 commit 370aa7e
Showing 1 changed file with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,18 +149,18 @@ public static byte[] create(byte[] value) {
/**
* Create Buffer with Text protocol values.
*
* @param rowDatas datas
* @param row row data
* @param columnTypes column types
* @return Buffer
*/
public static byte[] create(byte[][] rowDatas, ColumnType[] columnTypes) {
public static byte[] create(byte[][] row, ColumnType[] columnTypes) {

int totalLength = 0;
for (byte[] rowData : rowDatas) {
if (rowData == null) {
for (byte[] data : row) {
if (data == null) {
totalLength++;
} else {
int length = rowData.length;
int length = data.length;
if (length < 251) {
totalLength += length + 1;
} else if (length < 65536) {
Expand All @@ -175,11 +175,11 @@ public static byte[] create(byte[][] rowDatas, ColumnType[] columnTypes) {
byte[] buf = new byte[totalLength];

int pos = 0;
for (byte[] arr : rowDatas) {
if (arr == null) {
for (byte[] data : row) {
if (data == null) {
buf[pos++] = (byte) 251;
} else {
int length = arr.length;
int length = data.length;
if (length < 251) {
buf[pos++] = (byte) length;
} else if (length < 65536) {
Expand All @@ -200,7 +200,7 @@ public static byte[] create(byte[][] rowDatas, ColumnType[] columnTypes) {
// byte[] cannot have more than 4 byte length size, so buf[pos+5] -> buf[pos+8] = 0x00;
pos += 4;
}
System.arraycopy(arr, 0, buf, pos, length);
System.arraycopy(data, 0, buf, pos, length);
pos += length;
}
}
Expand Down

0 comments on commit 370aa7e

Please sign in to comment.