Apply TODOs

This commit is contained in:
gvolfing 2024-03-25 08:43:29 +01:00
parent dc2acf15e2
commit fd0f4a0346
2 changed files with 6 additions and 10 deletions

View File

@ -317,11 +317,9 @@ Result<EdgeAccessor> InMemoryStorage::InMemoryAccessor::CreateEdge(VertexAccesso
guard_from.lock();
}
// TODO short-circuit
if (storage_->config_.salient.items.enable_edge_type_index_auto_creation) {
if (!storage_->indices_.edge_type_index_->IndexExists(edge_type)) {
storage_->edge_types_to_auto_index_->emplace(edge_type);
}
if (storage_->config_.salient.items.enable_edge_type_index_auto_creation &&
!storage_->indices_.edge_type_index_->IndexExists(edge_type)) {
storage_->edge_types_to_auto_index_->emplace(edge_type);
}
if (!PrepareForWrite(&transaction_, from_vertex)) return Error::SERIALIZATION_ERROR;

View File

@ -118,11 +118,9 @@ Result<bool> VertexAccessor::AddLabel(LabelId label) {
storage_->stored_node_labels_.try_insert(label);
}
// TODO short-circuit
if (storage_->config_.salient.items.enable_label_index_auto_creation) {
if (!storage_->indices_.label_index_->IndexExists(label)) {
storage_->labels_to_auto_index_->emplace(label);
}
if (storage_->config_.salient.items.enable_label_index_auto_creation &&
!storage_->indices_.label_index_->IndexExists(label)) {
storage_->labels_to_auto_index_->emplace(label);
}
/// TODO: some by pointers, some by reference => not good, make it better