mirror of
https://github.com/ETLCPP/etl.git
synced 2026-11-09 14:49:53 +08:00
#815 etl::remove_if calls predicate twice for first iterator, where predicate returns true.
This commit is contained in:
parent
816e87ae00
commit
5e78b48b6c
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user