Skip to content

Commit dd93588

Browse files
author
chengyitian
committed
AJ-786: optimize code logic for BasicIotAnyVector get method;
1 parent 0f838c9 commit dd93588

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/com/xxdb/data/BasicIotAnyVector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ protected BasicIotAnyVector(ExtendedDataInput in) throws IOException {
8080
}
8181

8282
public Entity get(int index) {
83-
if (index > rows())
83+
if (index >= rows())
8484
throw new RuntimeException(String.format("index %s out of rows %s.", index, rows()));
8585

8686
BasicInt curDataType = (BasicInt) indexsDataType.get(index);

src/com/xxdb/multithreadedtablewriter/MultithreadedTableWriter.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -847,10 +847,9 @@ private List<Vector> createListVector(){
847847
int cols = colInfos_.length;
848848
for (int i = 0; i < cols; i++){
849849
Entity.DATA_TYPE type = colInfos_[i].type_;
850-
if (type.getValue() >= 65){
850+
if (type.getValue() >= 65) {
851851
tmp.add(new BasicArrayVector(type, 1, colInfos_[i].extra_));
852-
}
853-
else{
852+
} else {
854853
Vector value = BasicEntityFactory.instance().createVectorWithDefaultValue(type, 0, colInfos_[i].extra_);
855854
if (type == DT_DECIMAL32 || type == DT_DECIMAL64 || type == DT_DECIMAL128) {
856855
((AbstractVector)value).setExtraParamForType(colInfos_[i].extra_);

0 commit comments

Comments
 (0)