Changes and corrections before change request

Cucumber successfull
This commit is contained in:
xlaussel
2020-11-24 12:43:08 +01:00
parent 9a32722634
commit 8697a6b14a
3 changed files with 17 additions and 27 deletions
+3 -3
View File
@@ -297,17 +297,17 @@ class QueryHeap
boost::optional<HeapNode&> GetHeapNodeIfWasInserted(const NodeID node)
{
const auto index = node_index.peek_index(node);
if (index >= static_cast<decltype(index)>(inserted_nodes.size()))
if (index >= static_cast<decltype(index)>(inserted_nodes.size()) || inserted_nodes[index].node!=node)
{
return {};
}
return inserted_nodes[index];
}
const boost::optional<const HeapNode&> GetHeapNodeIfWasInserted(const NodeID node) const
boost::optional<const HeapNode&> GetHeapNodeIfWasInserted(const NodeID node) const
{
const auto index = node_index.peek_index(node);
if (index >= static_cast<decltype(index)>(inserted_nodes.size()))
if (index >= static_cast<decltype(index)>(inserted_nodes.size()) || inserted_nodes[index].node!=node)
{
return {};
}