remove unneeded test object,
[enigma2.git] / lib / base / ebase.cpp
index e51680966e43f08a00671a6740cff9c36f263ddd..f40bf39e78187bf8b45e527554165fff4fde739e 100644 (file)
@@ -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");
 }
 
@@ -337,10 +334,7 @@ PyObject *eMainloop::poll(ePyObject timeout, ePyObject dict)
        PyObject *res=0;
        
        if (app_quit_now)
-       {
-               Py_INCREF(Py_None);
-               return Py_None;
-       }
+               Py_RETURN_NONE;
        
        int user_timeout = (timeout == Py_None) ? 0 : PyInt_AsLong(timeout);