#815 etl::remove_if calls predicate twice for first iterator, where predicate returns true.

This commit is contained in:
John Wellbelove 2024-01-20 18:35:20 +00:00
parent 816e87ae00
commit 5e78b48b6c

View File

@ -2021,9 +2021,7 @@ namespace etl
template <typename TIterator, typename T>
ETL_CONSTEXPR14
TIterator remove(TIterator first, TIterator last, const T& value)
{
first = etl::find(first, last, value);
{
if (first != last)
{
TIterator itr = first;
@ -2051,8 +2049,6 @@ namespace etl
ETL_CONSTEXPR14
TIterator remove_if(TIterator first, TIterator last, TUnaryPredicate predicate)
{
first = etl::find_if(first, last, predicate);
if (first != last)
{
TIterator itr = first;