Skip to content

cleanup: replace erase-remove idiom with std::erase_if or absl::erase_if - #46663

Open
Amila-Rukshan wants to merge 1 commit into
envoyproxy:mainfrom
Amila-Rukshan:improve-readability
Open

cleanup: replace erase-remove idiom with std::erase_if or absl::erase_if#46663
Amila-Rukshan wants to merge 1 commit into
envoyproxy:mainfrom
Amila-Rukshan:improve-readability

Conversation

@Amila-Rukshan

@Amila-Rukshan Amila-Rukshan commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Description

Replace the traditional erase-remove idiom with the more concise std::erase_if and absl::erase_if APIs where applicable.

This improves readability by expressing the intent to remove elements matching a predicate directly, while preserving the existing behavior.

Changes

Replace std::remove_if followed by erase with std::erase_if for standard containers.
Replace the same pattern with absl::erase_if for supported Abseil containers.

No functional behavior changes are intended.

…ve idiom

Signed-off-by: Amila Senadheera <amilaruk1995@gmail.com>
@Amila-Rukshan

Copy link
Copy Markdown
Contributor Author

/retest

@Amila-Rukshan Amila-Rukshan changed the title Use convenient std::erase_if or absl::erase_if instead of erase-remove idiom cleanup: replace erase-remove idiom with std::erase_if or absl::erase_if Aug 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants