Skip to content

Commit

Permalink
Replace current cell reference with copy (#1690)
Browse files Browse the repository at this point in the history
The cell reference becomes invalidated as the reference becomes invalid when a new  cell is added to the vector

Signed-off-by: Shrijit Singh <shrijitsingh99@gmail.com>
  • Loading branch information
shrijitsingh99 authored May 5, 2020
1 parent 0af05e3 commit 368b3c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nav2_costmap_2d/test/integration/inflation_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ void TestNode::validatePointInflation(
bin != m.end(); ++bin)
{
for (unsigned int i = 0; i < bin->second.size(); ++i) {
const CellData & cell = bin->second[i];
const CellData cell = bin->second[i];
if (!seen[cell.index_]) {
seen[cell.index_] = true;
unsigned int dx = (cell.x_ > cell.src_x_) ? cell.x_ - cell.src_x_ : cell.src_x_ - cell.x_;
Expand Down

0 comments on commit 368b3c1

Please sign in to comment.