Skip to content

Commit 381f214

Browse files
committed
replace indices entirely
1 parent 7b74174 commit 381f214

File tree

1 file changed

+4
-3
lines changed
  • iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure

1 file changed

+4
-3
lines changed

iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/datastructure/TVList.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,12 +334,13 @@ protected void set(int index, long timestamp, int valueIndex) {
334334
timestamps.get(arrayIndex)[elementIndex] = timestamp;
335335
// prepare indices for sorting
336336
if (indices == null) {
337-
indices = new ArrayList<>(getDefaultArrayNum());
337+
List<int[]> tmpIndices = new ArrayList<>(getDefaultArrayNum());
338338
for (int i = 0; i < timestamps.size(); i++) {
339-
indices.add((int[]) getPrimitiveArraysByType(TSDataType.INT32));
339+
tmpIndices.add((int[]) getPrimitiveArraysByType(TSDataType.INT32));
340340
int offset = i * ARRAY_SIZE;
341-
Arrays.setAll(indices.get(i), j -> offset + j);
341+
Arrays.setAll(tmpIndices.get(i), j -> offset + j);
342342
}
343+
indices = tmpIndices;
343344
}
344345
indices.get(arrayIndex)[elementIndex] = valueIndex;
345346
}

0 commit comments

Comments
 (0)