Mercurial > octave-libtiff
changeset 30173:f8ee588f1c7d
maint: Replace pid_equal helper class with lambda function.
* child-list.cc: Delete pid_equal helper class.
* child-list.cc (remove): Use lambda function in call to remove_if().
author | Rik <rik@octave.org> |
---|---|
date | Tue, 14 Sep 2021 10:34:28 -0700 |
parents | dbfa0f70d9bd |
children | 1e49b26c1ead |
files | liboctave/system/child-list.cc |
diffstat | 1 files changed, 1 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/liboctave/system/child-list.cc Mon Sep 13 21:29:14 2021 -0700 +++ b/liboctave/system/child-list.cc Tue Sep 14 10:34:28 2021 -0700 @@ -32,22 +32,9 @@ namespace octave { - class pid_equal - { - public: - - pid_equal (pid_t v) : val (v) { } - - bool operator () (const child& oc) const { return oc.m_pid == val; } - - private: - - pid_t val; - }; - void child_list::remove (pid_t pid) { - m_list.remove_if (pid_equal (pid)); + m_list.remove_if ([pid] (const child& oc) { return oc.m_pid == pid; }); } void child_list::child_list::insert (pid_t pid, child::child_event_handler f)