fix erase_if method
This commit is contained in:
@@ -390,7 +390,7 @@ namespace rsx
|
||||
}
|
||||
|
||||
bool ret = false;
|
||||
for (auto ptr = _data, last = _data + _size - 1; ptr <= last; ptr++)
|
||||
for (auto ptr = _data, last = _data + (_size - 1); ptr <= last; ptr++)
|
||||
{
|
||||
if (predicate(*ptr))
|
||||
{
|
||||
@@ -405,7 +405,7 @@ namespace rsx
|
||||
|
||||
// Move item to the end of the list and shrink by 1
|
||||
std::memcpy(ptr, last, sizeof(Ty));
|
||||
last = _data + (--_size);
|
||||
last = _data + (--_size - 1); // set new last
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user