mirror of
https://github.com/boostorg/geometry.git
synced 2026-02-17 13:52:09 +00:00
added small optimization in range_collect_vectors - erase() replaced by copy from back and pop_back()
This commit is contained in:
@@ -161,7 +161,12 @@ struct range_collect_vectors
|
||||
c_iterator first = collection.begin() + c_old_size;
|
||||
|
||||
if ( first->same_direction(collection.back()) )
|
||||
collection.erase(first);
|
||||
{
|
||||
//collection.erase(first);
|
||||
// O(1) instead of O(N)
|
||||
*first = collection.back();
|
||||
collection.pop_back();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user