Skip to content

Commit

Permalink
Fix bug introduced in commit 6b6c8d5,
Browse files Browse the repository at this point in the history
Bug identified by Laurence, and reported in issue #11.
  • Loading branch information
Nicolas Mellado authored and Nicolas Mellado committed May 18, 2016
1 parent 2baa30e commit ef7f054
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions super4pcs/accelerators/pairExtraction/intersectionNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,10 @@ NdNode< Point, _dim, Scalar, _PointContainer, _IdContainer>::split(
}

// Remove childs not containing any element
childs.erase(std::remove_if(childs.begin(), childs.end(), [](Node& c)
{return c.rangeLength() == 0; }));
if (!childs.empty()) {
childs.erase(std::remove_if(childs.begin(), childs.end()-1, [](const Node& c)
{return c.rangeLength() == 0; }));
}
}

} // namespace Accelerators
Expand Down

0 comments on commit ef7f054

Please sign in to comment.