From e82955895a519379cee39c308d1960baaf8720c0 Mon Sep 17 00:00:00 2001 From: jbajic <jure.bajic@memgraph.com> Date: Tue, 20 Dec 2022 16:14:01 +0100 Subject: [PATCH] Leave a TODO --- src/storage/v3/indices.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/storage/v3/indices.cpp b/src/storage/v3/indices.cpp index dd2bdf75e..2f11a35ec 100644 --- a/src/storage/v3/indices.cpp +++ b/src/storage/v3/indices.cpp @@ -654,6 +654,7 @@ int64_t LabelPropertyIndex::VertexCount(LabelId label, PropertyId property, cons MG_ASSERT(it != index_.end(), "Index for label {} and property {} doesn't exist", label.AsUint(), property.AsUint()); MG_ASSERT(!value.IsNull(), "Null is not supported!"); + // TODO(jbajic) This can be improved by exiting early auto start_it = std::ranges::lower_bound(it->second, value, std::less{}, &Entry::value); return static_cast<int64_t>( std::ranges::count_if(start_it, it->second.end(), [&value](const auto &elem) { return elem.value == value; }));