From 7133236c65893801d0bf2908c36ed62d8b80840b Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Fri, 6 Jan 2023 10:19:05 -0500 Subject: [PATCH] common return statements --- gtsam/inference/EliminateableFactorGraph-inst.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/gtsam/inference/EliminateableFactorGraph-inst.h b/gtsam/inference/EliminateableFactorGraph-inst.h index bebce14cd2..9e01d07651 100644 --- a/gtsam/inference/EliminateableFactorGraph-inst.h +++ b/gtsam/inference/EliminateableFactorGraph-inst.h @@ -43,18 +43,15 @@ namespace gtsam { // VariableIndex already here because we computed one if needed in the previous 'if' block. if (orderingType == Ordering::METIS) { Ordering computedOrdering = Ordering::Metis(asDerived()); - return eliminateSequential(computedOrdering, function, variableIndex); } else if (orderingType == Ordering::COLAMD) { Ordering computedOrdering = Ordering::Colamd(*variableIndex); - return eliminateSequential(computedOrdering, function, variableIndex); } else if (orderingType == Ordering::NATURAL) { Ordering computedOrdering = Ordering::Natural(asDerived()); - return eliminateSequential(computedOrdering, function, variableIndex); } else { Ordering computedOrdering = EliminationTraitsType::DefaultOrderingFunc( asDerived(), variableIndex); - return eliminateSequential(computedOrdering, function, variableIndex); } + return eliminateSequential(computedOrdering, function, variableIndex); } } @@ -106,18 +103,15 @@ namespace gtsam { // the previous 'if' block. if (orderingType == Ordering::METIS) { Ordering computedOrdering = Ordering::Metis(asDerived()); - return eliminateMultifrontal(computedOrdering, function, variableIndex); } else if (orderingType == Ordering::COLAMD) { Ordering computedOrdering = Ordering::Colamd(*variableIndex); - return eliminateMultifrontal(computedOrdering, function, variableIndex); } else if (orderingType == Ordering::NATURAL) { Ordering computedOrdering = Ordering::Natural(asDerived()); - return eliminateMultifrontal(computedOrdering, function, variableIndex); } else { Ordering computedOrdering = EliminationTraitsType::DefaultOrderingFunc( asDerived(), variableIndex); - return eliminateMultifrontal(computedOrdering, function, variableIndex); } + return eliminateMultifrontal(computedOrdering, function, variableIndex); } }