Skip to content

the i at the second for loop should be reinit to be zero #3532

@dahuacai

Description

@dahuacai

Issue Place:
navigation2/nav2_theta_star_planner/src/ThetaStar::initializePosn(int size_inc)
raw code:
`void ThetaStar::initializePosn(int size_inc)
{
int i = 0;

if (!node_position_.empty()) {
for (; i < size_x_ * size_y_; i++) {
node_position_[i] = nullptr;
}
}

for (; i < size_inc; i++) {
node_position_.push_back(nullptr);
}
}`

Question:
the i at the second for loop if need reinit to be 0 ? otherwise the second loop may not work some time and access transgressions can also occur at other place

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions