summaryrefslogtreecommitdiff
path: root/epg.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-12-26 15:09:21 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-12-26 15:09:21 +0100
commit2d5f3497bf9799f8ffe15795f6e91bf643e35589 (patch)
tree05abc2f21b76cd033888d6de0dbea8d730c0c6d1 /epg.c
parent56f49073092ef1726d949e35454382bd4d38abb9 (diff)
downloadvdr-2d5f3497bf9799f8ffe15795f6e91bf643e35589.tar.gz
vdr-2d5f3497bf9799f8ffe15795f6e91bf643e35589.tar.bz2
Modified cSchedule::Cleanup() (events are always sorted by time)
Diffstat (limited to 'epg.c')
-rw-r--r--epg.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/epg.c b/epg.c
index 7fe44905..3407f34f 100644
--- a/epg.c
+++ b/epg.c
@@ -7,7 +7,7 @@
* Original version (as used in VDR before 1.3.0) written by
* Robert Schneider <Robert.Schneider@web.de> and Rolf Hakenes <hakenes@hippomi.de>.
*
- * $Id: epg.c 1.43 2005/12/26 14:47:55 kls Exp $
+ * $Id: epg.c 1.44 2005/12/26 15:09:03 kls Exp $
*/
#include "epg.h"
@@ -767,15 +767,12 @@ void cSchedule::Cleanup(void)
void cSchedule::Cleanup(time_t Time)
{
cEvent *Event;
- for (int a = 0; true ; a++) {
- Event = events.Get(a);
- if (!Event)
- break;
- if (!Event->HasTimer() && Event->EndTime() + Setup.EPGLinger * 60 + 3600 < Time) { // adding one hour for safety
- DelEvent(Event);
- a--;
- }
- }
+ while ((Event = events.First()) != NULL) {
+ if (!Event->HasTimer() && Event->EndTime() + Setup.EPGLinger * 60 + 3600 < Time) // adding one hour for safety
+ DelEvent(Event);
+ else
+ break;
+ }
}
void cSchedule::Dump(FILE *f, const char *Prefix, eDumpMode DumpMode, time_t AtTime) const