Avoid unnecessary start time calculations
Rename recur_*_inday() to recur_*_find_occurrence() and use the new functions whenever we actually care about the start time of an occurrence. Reintroduce recur_*_inday() as wrappers to recur_*_find_occurrence() and pass NULL as start time buffer (which means "skip start time calculation"). Keep using these when we only want to know if a recurrent item belongs to a specific day but do not care about the actual start time. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
11
src/day.c
11
src/day.c
@@ -225,10 +225,13 @@ day_store_recur_apoints (long date)
|
||||
LLIST_TS_FIND_FOREACH (&recur_alist_p, date, recur_apoint_inday, i)
|
||||
{
|
||||
struct recur_apoint *rapt = LLIST_TS_GET_DATA (i);
|
||||
int real_start = recur_apoint_inday (rapt, date);
|
||||
(void)day_add_apoint (RECUR_APPT, rapt->mesg, rapt->note, real_start,
|
||||
rapt->dur, rapt->state, a_nb);
|
||||
a_nb++;
|
||||
unsigned real_start;
|
||||
if (recur_apoint_find_occurrence (rapt, date, &real_start))
|
||||
{
|
||||
(void)day_add_apoint (RECUR_APPT, rapt->mesg, rapt->note, real_start,
|
||||
rapt->dur, rapt->state, a_nb);
|
||||
a_nb++;
|
||||
}
|
||||
}
|
||||
LLIST_TS_UNLOCK (&recur_alist_p);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user