handle empty vectors in TinySet
This commit is contained in:
parent
7429a39b48
commit
22780c4559
@ -228,9 +228,12 @@ class TinySet
|
||||
private:
|
||||
iterator unique_cmp (iterator first, iterator last)
|
||||
{
|
||||
if (first == last) {
|
||||
return last;
|
||||
}
|
||||
iterator result = first;
|
||||
while (++first != last) {
|
||||
if ( cmp_(*result, *first)) {
|
||||
if (cmp_(*result, *first)) {
|
||||
*(++result) = *first;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user