From 70ffbf32bcb535f3275eba2c65318b2a62dda62f Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Thu, 8 Jun 2023 13:16:49 -0400 Subject: [PATCH] mark nrAssignments as const --- gtsam/discrete/DecisionTreeFactor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtsam/discrete/DecisionTreeFactor.cpp b/gtsam/discrete/DecisionTreeFactor.cpp index 5fb5ae2e6..4aca10a28 100644 --- a/gtsam/discrete/DecisionTreeFactor.cpp +++ b/gtsam/discrete/DecisionTreeFactor.cpp @@ -307,7 +307,7 @@ namespace gtsam { // Get the probabilities in the decision tree so we can threshold. std::vector probabilities; this->visitLeaf([&](const Leaf& leaf) { - size_t nrAssignments = leaf.nrAssignments(); + const size_t nrAssignments = leaf.nrAssignments(); double prob = leaf.constant(); probabilities.insert(probabilities.end(), nrAssignments, prob); });