From: Andreas Monzner Date: Tue, 12 Dec 2006 19:58:22 +0000 (+0000) Subject: nicer code X-Git-Tag: 2.6.0~2596 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/1394bbf36f7e0cc591f1a31b7d5db4e8f0f2c0c6 nicer code --- 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::iterator i = notifiers.find(sn->getFD()); - i != notifiers.end(); - ++i) - if (i->second == sn) - return notifiers.erase(i); - for (std::map::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::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"); }