RN_NET::GetClosestNodes() minor fix.
This commit is contained in:
parent
3049bc1d5f
commit
781ac8df9f
|
@ -613,9 +613,8 @@ std::list<RN_NODE_PTR> RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode, int aN
|
||||||
// Sort by the distance from aNode
|
// Sort by the distance from aNode
|
||||||
closest.sort( boost::bind( sortDistance, boost::cref( aNode ), _1, _2 ) );
|
closest.sort( boost::bind( sortDistance, boost::cref( aNode ), _1, _2 ) );
|
||||||
|
|
||||||
// Remove the first node (==aNode), as it is surely located within the smallest distance
|
// aNode should not be returned in the results
|
||||||
assert( closest.front() == aNode );
|
closest.remove( aNode );
|
||||||
closest.pop_front();
|
|
||||||
|
|
||||||
// Trim the result to the asked size
|
// Trim the result to the asked size
|
||||||
if( aNumber > 0 )
|
if( aNumber > 0 )
|
||||||
|
@ -638,9 +637,8 @@ std::list<RN_NODE_PTR> RN_NET::GetClosestNodes( const RN_NODE_PTR& aNode,
|
||||||
// Sort by the distance from aNode
|
// Sort by the distance from aNode
|
||||||
closest.sort( boost::bind( sortDistance, boost::cref( aNode ), _1, _2 ) );
|
closest.sort( boost::bind( sortDistance, boost::cref( aNode ), _1, _2 ) );
|
||||||
|
|
||||||
// Remove the first node (==aNode), as it is surely located within the smallest distance
|
// aNode should not be returned in the results
|
||||||
assert( closest.front() == aNode );
|
closest.remove( aNode );
|
||||||
closest.pop_front();
|
|
||||||
|
|
||||||
// Filter out by condition
|
// Filter out by condition
|
||||||
std::remove_if( closest.begin(), closest.end(), aFilter );
|
std::remove_if( closest.begin(), closest.end(), aFilter );
|
||||||
|
|
Loading…
Reference in New Issue