This commit is contained in:
Andrea Cavalli 2024-10-24 02:12:53 +02:00
parent 16f8b8e43f
commit 60b3ff5a58

View File

@ -181,10 +181,11 @@ public class EmbeddedDB implements RocksDBSyncAPI, Closeable {
var columnName = new String(column.cfh().getName(), StandardCharsets.UTF_8); var columnName = new String(column.cfh().getName(), StandardCharsets.UTF_8);
long hashCode = columnName.hashCode(); long hashCode = columnName.hashCode();
long id; long id;
if (this.columnNamesIndex.get(columnName) == hashCode) { if (Objects.equals(this.columnNamesIndex.get(columnName), hashCode)) {
id = hashCode; id = hashCode;
} else if (this.columns.get(hashCode) == null) { } else if (this.columns.get(hashCode) == null) {
id = hashCode; id = hashCode;
this.columns.put(id, column);
} else { } else {
id = FastRandomUtils.allocateNewValue(this.columns, column, 1, Long.MAX_VALUE); id = FastRandomUtils.allocateNewValue(this.columns, column, 1, Long.MAX_VALUE);
} }