mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 12:13:43 +00:00
ifcparse: build the RocksDB inverse prefix in all_referencing_instances with rocksdb_key
Since #9508 the numeric key segments are fixed-width hex; the one hand-built "v|" + std::to_string(id) prefix wouldn't have matched. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HNrXDmR88wKPCYwGE21SyH
This commit is contained in:
@@ -3173,7 +3173,7 @@ bool file::all_referencing_instances(int instance_id, const std::function<bool(u
|
||||
#ifdef IFOPSH_WITH_ROCKSDB
|
||||
else if constexpr (std::is_same_v<std::decay_t<decltype(x)>, impl::rocks_db_file_storage>) {
|
||||
// @todo no lower/upper_bounds() implemented yet
|
||||
auto prefix = "v|" + std::to_string(instance_id) + "|";
|
||||
auto prefix = rocksdb_key::inverse_prefix(instance_id);
|
||||
auto it = std::unique_ptr<rocksdb::Iterator>(x.db->NewIterator(rocksdb::ReadOptions()));
|
||||
it->Seek(prefix);
|
||||
while (it->Valid() && it->key().starts_with(prefix)) {
|
||||
|
||||
Reference in New Issue
Block a user