Fix ClearForcedSegments() in vwp2
Change-Id: Id8415a22d15d1f5130ffa7cb0afb7966a402cc5e
Reviewed-on: https://chromium-review.googlesource.com/c/codecs/libwebp2/+/4251880
Tested-by: WebM Builds <builds@webmproject.org>
Reviewed-by: Maryla Ustarroz-Calonge <maryla@google.com>
diff --git a/examples/vwp2.cc b/examples/vwp2.cc
index 33bf15d..eeceb53 100644
--- a/examples/vwp2.cc
+++ b/examples/vwp2.cc
@@ -1454,11 +1454,13 @@
namespace {
void ClearForcedSegments(std::vector<EncoderInfo::ForcedParam>* params) {
- std::remove_if(params->begin(), params->end(),
- [](const EncoderInfo::ForcedParam& forced) {
- return forced.type ==
- EncoderInfo::ForcedParam::Type::kSegment;
- });
+ params->erase(
+ std::remove_if(params->begin(), params->end(),
+ [](const EncoderInfo::ForcedParam& forced) {
+ return forced.type ==
+ EncoderInfo::ForcedParam::Type::kSegment;
+ }),
+ params->end());
}
} // namespace