This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/83786] New: Add VEC_ORDERED_REMOVE_IF
- From: "vries at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 11 Jan 2018 08:58:42 +0000
- Subject: [Bug other/83786] New: Add VEC_ORDERED_REMOVE_IF
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83786
Bug ID: 83786
Summary: Add VEC_ORDERED_REMOVE_IF
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: trivial
Priority: P3
Component: other
Assignee: unassigned at gcc dot gnu.org
Reporter: vries at gcc dot gnu.org
Target Milestone: ---
There's a common pattern of using vec::ordered_remove in a loop to remove some
elements, which has O(n^2) complexity.
I've written a patch that adds the macro VEC_ORDERED_REMOVE_IF which can be
used in such a case to achieve the same, but with O(n) complexity.