remove unneeded code
[enigma2.git] / lib / dvb / epgcache.cpp
index 6dea73bc354d88b1d5f06c06d801a7a694bbb1a2..fb121ae8e4dbadfe32546891e45ed8ab9a8a31ba 100644 (file)
@@ -1009,29 +1009,11 @@ RESULT eEPGCache::lookupEventTime(const eServiceReference &service, time_t t, co
                if (!t)
                        t = time(0)+eDVBLocalTimeHandler::getInstance()->difference();
 
-// TODO: optimize this.. why we here search first in timemap.. and then in eventmap??
                timeMap::iterator i = It->second.second.lower_bound(t);
-               if ( i != It->second.second.end() )
+               if ( i != It->second.second.end() && t <= i->first+i->second->getDuration() )
                {
-                       if ( i != It->second.second.end() )
-                       {
-                               if ( t <= i->first+i->second->getDuration() )
-                               {
-                                       result = i->second;
-                                       return 0;
-                               }
-                       }
-               }
-
-               for ( eventMap::iterator i( It->second.first.begin() ); i != It->second.first.end(); i++)
-               {
-                       int duration = i->second->getDuration();
-                       time_t begTime = i->second->getStartTime();
-                       if ( t >= begTime && t <= begTime+duration) // then we have found
-                       {
-                               result = i->second;
-                               return 0;
-                       }
+                       result = i->second;
+                       return 0;
                }
        }
        return -1;