summaryrefslogtreecommitdiff
path: root/src/select.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/select.cpp')
-rw-r--r--src/select.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/select.cpp b/src/select.cpp
index 9d0970a..78d3afd 100644
--- a/src/select.cpp
+++ b/src/select.cpp
@@ -191,15 +191,8 @@ void zmq::select_t::loop ()
// Destroy retired event sources.
if (retired) {
- fd_set_t::iterator it = fds.begin();
- while (it != fds.end()) {
- if (it->fd == retired_fd) {
- it = fds.erase(it);
- }
- else {
- it++;
- }
- }
+ fds.erase (std::remove_if (fds.begin (), fds.end (),
+ zmq::select_t::is_retired_fd), fds.end ());
retired = false;
}
}
@@ -209,3 +202,9 @@ void zmq::select_t::worker_routine (void *arg_)
{
((select_t*) arg_)->loop ();
}
+
+bool zmq::select_t::is_retired_fd (const fd_entry_t &entry)
+{
+ return (entry.fd == retired_fd);
+}
+