From c940d490ef42076cb83a0be23e1000bf051ae259 Mon Sep 17 00:00:00 2001 From: Elias Foramitti Date: Mon, 15 Jan 2024 07:54:21 +0100 Subject: [PATCH] ignore bugprone-branch-clone lint warning --- src/heuristic/HeuristicMapper.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/heuristic/HeuristicMapper.cpp b/src/heuristic/HeuristicMapper.cpp index abbd93515..2feb9c220 100644 --- a/src/heuristic/HeuristicMapper.cpp +++ b/src/heuristic/HeuristicMapper.cpp @@ -865,6 +865,9 @@ void HeuristicMapper::recalculateFixedCostNonFidelity(Node& node) { // swap costs for (auto& swap : node.swaps) { if (swap.op == qc::SWAP) { + // branch clone intended for performance reasons (checking edge-wise for + // bidirectionality is not O(1)) + // NOLINTBEGIN(bugprone-branch-clone) if (architecture->bidirectional()) { node.costFixed += COST_BIDIRECTIONAL_SWAP; } else if (architecture->unidirectional() || @@ -874,6 +877,7 @@ void HeuristicMapper::recalculateFixedCostNonFidelity(Node& node) { } else { node.costFixed += COST_BIDIRECTIONAL_SWAP; } + // NOLINTEND(bugprone-branch-clone) } else if (swap.op == qc::Teleportation) { node.costFixed += COST_TELEPORTATION; } @@ -1019,6 +1023,9 @@ void HeuristicMapper::applySWAP(const Edge& swap, std::size_t layer, node.costFixed += architecture->getSwapFidelityCost(swap.first, swap.second); } else { + // branch clone intended for performance reasons (checking edge-wise for + // bidirectionality is not O(1)) + // NOLINTBEGIN(bugprone-branch-clone) if (architecture->bidirectional()) { node.costFixed += COST_BIDIRECTIONAL_SWAP; } else if (architecture->unidirectional() || @@ -1027,6 +1034,7 @@ void HeuristicMapper::applySWAP(const Edge& swap, std::size_t layer, } else { node.costFixed += COST_BIDIRECTIONAL_SWAP; } + // NOLINTEND(bugprone-branch-clone) } recalculateFixedCostReversals(layer, node);