Add a comment about potentiall returning reference to id hash-set in fetch_ids_from_index.

This commit is contained in:
Yuriy Dupyn 2024-01-08 15:20:22 +01:00
parent b04f3d167b
commit ba2c1bae6d

View file

@ -218,6 +218,9 @@ impl Table {
} else { } else {
match self.indexes.get(&column_position) { match self.indexes.get(&column_position) {
Some(index) => { Some(index) => {
// Note that we are cloning the ids here! This can be very wasteful in some cases.
// It would be possible to just return a reference,
// but this seems fairly non-trivial.
let ids = index.get(value).cloned(); let ids = index.get(value).cloned();
Ok(ids) Ok(ids)
} }