Skip to content

Commit 1abebf0

Browse files
author
chengyitian
committed
AJ-463: fix replaceColumn logic.
1 parent 22c9024 commit 1abebf0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/com/xxdb/data/BasicTable.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,7 @@ public void replaceColumn(String colName, Vector col) {
410410
if (this.colRows != 0 && col.rows() != this.colRows)
411411
throw new RuntimeException("The length of column " + colName + " must be the same as the first column length: " + this.colRows +".");
412412

413-
colNames.add(colName);
414-
colNamesIndex.put(colName, colNamesIndex.size());
415-
columns.add(col);
416-
this.colRows = col.rows();
413+
int index = colNames.indexOf(colName);
414+
columns.set(index, col);
417415
}
418416
}

0 commit comments

Comments
 (0)