From 8b722771f3f287032b43d51b4f96b5653eceae34 Mon Sep 17 00:00:00 2001 From: Steve Macenski Date: Mon, 5 Jun 2023 14:05:38 -0700 Subject: [PATCH] Resolve #3532: reset i (#3597) --- nav2_theta_star_planner/src/theta_star.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nav2_theta_star_planner/src/theta_star.cpp b/nav2_theta_star_planner/src/theta_star.cpp index baddc754d7..9432f867a4 100644 --- a/nav2_theta_star_planner/src/theta_star.cpp +++ b/nav2_theta_star_planner/src/theta_star.cpp @@ -248,15 +248,13 @@ void ThetaStar::resetContainers() void ThetaStar::initializePosn(int size_inc) { - int i = 0; - if (!node_position_.empty()) { - for (; i < size_x_ * size_y_; i++) { + for (int i = 0; i < size_x_ * size_y_; i++) { node_position_[i] = nullptr; } } - for (; i < size_inc; i++) { + for (int i = 0; i < size_inc; i++) { node_position_.push_back(nullptr); } }