提交 53b11416 authored 作者: Evgenij Ryazanov's avatar Evgenij Ryazanov

Use 1 byte for deleted flag in RowList

上级 3d85a5bc
......@@ -48,14 +48,14 @@ public class RowList implements AutoCloseable {
}
private void writeRow(Data buff, Row r) {
buff.checkCapacity(1 + Data.LENGTH_INT * 8);
buff.checkCapacity(2 + Data.LENGTH_INT * 3 + Data.LENGTH_LONG);
buff.writeByte((byte) 1);
buff.writeInt(r.getMemory());
int columnCount = r.getColumnCount();
buff.writeInt(columnCount);
buff.writeLong(r.getKey());
buff.writeInt(r.getVersion());
buff.writeInt(r.isDeleted() ? 1 : 0);
buff.writeByte(r.isDeleted() ? (byte) 1 : (byte) 0);
for (int i = 0; i < columnCount; i++) {
Value v = r.getValue(i);
buff.checkCapacity(1);
......@@ -168,7 +168,7 @@ public class RowList implements AutoCloseable {
int columnCount = buff.readInt();
long key = buff.readLong();
int version = buff.readInt();
boolean deleted = buff.readInt() == 1;
boolean deleted = buff.readByte() != 0;
Value[] values = new Value[columnCount];
for (int i = 0; i < columnCount; i++) {
Value v;
......
......@@ -73,7 +73,7 @@ public class Data {
/**
* The length of a long value.
*/
private static final int LENGTH_LONG = 8;
public static final int LENGTH_LONG = 8;
/**
* Storage type for ValueRow.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论