Remove unneccessar branch in CoreCH code

This commit is contained in:
Patrick Niklaus 2017-03-03 13:28:11 +00:00 committed by Patrick Niklaus
parent c2a5cc034a
commit 93cdd8bb46
3 changed files with 2 additions and 11 deletions

View File

@ -57,8 +57,6 @@ template <> class AlgorithmDataFacade<algorithm::CoreCH>
using EdgeData = contractor::QueryEdge::EdgeData; using EdgeData = contractor::QueryEdge::EdgeData;
virtual bool IsCoreNode(const NodeID id) const = 0; virtual bool IsCoreNode(const NodeID id) const = 0;
virtual std::size_t GetCoreSize() const = 0;
}; };
} }
} }

View File

@ -175,15 +175,9 @@ class ContiguousInternalMemoryAlgorithmDataFacade<algorithm::CoreCH>
bool IsCoreNode(const NodeID id) const override final bool IsCoreNode(const NodeID id) const override final
{ {
if (m_is_core_node.size() > 0) BOOST_ASSERT(id < m_is_core_node.size());
{ return m_is_core_node[id];
return m_is_core_node.at(id);
}
return false;
} }
std::size_t GetCoreSize() const override final { return m_is_core_node.size(); }
}; };
/** /**

View File

@ -289,7 +289,6 @@ class MockAlgorithmDataFacade<engine::algorithm::CoreCH>
public: public:
bool IsCoreNode(const NodeID /* id */) const override { return false; } bool IsCoreNode(const NodeID /* id */) const override { return false; }
std::size_t GetCoreSize() const override { return 0; }
}; };
template <typename AlgorithmT> template <typename AlgorithmT>