From ebbe24966c769891e819da9e5ff9af3c77a7c90b Mon Sep 17 00:00:00 2001 From: Geza Lore Date: Fri, 26 Aug 2022 18:14:53 +0100 Subject: [PATCH] Remove unnecessary virtual methods --- src/V3Order.cpp | 10 +++------- src/V3Partition.cpp | 9 +++------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/src/V3Order.cpp b/src/V3Order.cpp index 421eae567..d2bc97118 100644 --- a/src/V3Order.cpp +++ b/src/V3Order.cpp @@ -790,7 +790,7 @@ class OrderVerticesByDomainThenScope final { PartPtrIdMap m_ids; public: - virtual bool operator()(const V3GraphVertex* lhsp, const V3GraphVertex* rhsp) const { + bool operator()(const V3GraphVertex* lhsp, const V3GraphVertex* rhsp) const { const MTaskMoveVertex* const l_vxp = dynamic_cast(lhsp); const MTaskMoveVertex* const r_vxp = dynamic_cast(rhsp); uint64_t l_id = m_ids.findId(l_vxp->domainp()); @@ -803,14 +803,10 @@ public: } }; -class MTaskVxIdLessThan final { -public: - MTaskVxIdLessThan() = default; - virtual ~MTaskVxIdLessThan() = default; - +struct MTaskVxIdLessThan final { // Sort vertex's, which must be AbstractMTask's, into a deterministic // order by comparing their serial IDs. - virtual bool operator()(const V3GraphVertex* lhsp, const V3GraphVertex* rhsp) const { + bool operator()(const V3GraphVertex* lhsp, const V3GraphVertex* rhsp) const { const AbstractMTask* const lmtaskp = dynamic_cast(lhsp); const AbstractMTask* const rmtaskp = dynamic_cast(rhsp); return lmtaskp->id() < rmtaskp->id(); diff --git a/src/V3Partition.cpp b/src/V3Partition.cpp index b31a3967a..1d8f00438 100644 --- a/src/V3Partition.cpp +++ b/src/V3Partition.cpp @@ -394,11 +394,8 @@ private: // Sort AbstractMTask objects into deterministic order by calling id() // which is a unique and stable serial number. -class MTaskIdLessThan final { -public: - MTaskIdLessThan() = default; - virtual ~MTaskIdLessThan() = default; - virtual bool operator()(const AbstractMTask* lhsp, const AbstractMTask* rhsp) const { +struct MTaskIdLessThan final { + bool operator()(const AbstractMTask* lhsp, const AbstractMTask* rhsp) const { return lhsp->id() < rhsp->id(); } }; @@ -727,7 +724,7 @@ class OrderByPtrId final { PartPtrIdMap m_ids; public: - virtual bool operator()(const OrderVarStdVertex* lhsp, const OrderVarStdVertex* rhsp) const { + bool operator()(const OrderVarStdVertex* lhsp, const OrderVarStdVertex* rhsp) const { const uint64_t l_id = m_ids.findId(lhsp); const uint64_t r_id = m_ids.findId(rhsp); return l_id < r_id;