]> git.ipfire.org Git - thirdparty/gcc.git/commit
cobol: Replace quadratic loop removing std::set elements
authorJonathan Wakely <jwakely@redhat.com>
Wed, 19 Mar 2025 20:33:36 +0000 (20:33 +0000)
committerJames K. Lowden <jklowden@cobolworx.com>
Wed, 26 Mar 2025 20:49:11 +0000 (16:49 -0400)
commit57d711ba58f8a69dce22b2a543d8e6c668680865
tree5ca1aeb8214a9eb8510d0da2b7198ba9080ba1f7
parent96b048329c828d29ab5e3ac67da6bdc841eb608b
cobol: Replace quadratic loop removing std::set elements

There's no need to keep using std::find_if from the beginning of the
container after every removal, just update the iterator after erasing an
element.

This is how C++20 std::erase_if is implemented.

gcc/cobol/ChangeLog:

* except.cc (cbl_enabled_exceptions_t::turn_on_off): Replace
quadratic loop with a single pass.
gcc/cobol/except.cc