diff options
Diffstat (limited to 'lib/base/ebase.cpp')
| -rw-r--r-- | lib/base/ebase.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/lib/base/ebase.cpp b/lib/base/ebase.cpp index e5168096..75307e85 100644 --- a/lib/base/ebase.cpp +++ b/lib/base/ebase.cpp @@ -124,16 +124,13 @@ void eMainloop::addSocketNotifier(eSocketNotifier *sn) void eMainloop::removeSocketNotifier(eSocketNotifier *sn) { - for (std::map<int,eSocketNotifier*>::iterator i = notifiers.find(sn->getFD()); - i != notifiers.end(); - ++i) - if (i->second == sn) - return notifiers.erase(i); - for (std::map<int,eSocketNotifier*>::iterator i = new_notifiers.find(sn->getFD()); - i != new_notifiers.end(); - ++i) - if (i->second == sn) - return new_notifiers.erase(i); + int fd = sn->getFD(); + std::map<int,eSocketNotifier*>::iterator i(notifiers.find(fd)); + if (i != notifiers.end()) + return notifiers.erase(i); + i = new_notifiers.find(fd); + if (i != new_notifiers.end()) + return new_notifiers.erase(i); eFatal("removed socket notifier which is not present"); } |
