diff options
author | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-11-02 14:19:20 +0100 |
---|---|---|
committer | Lukas Fleischer <calcurse@cryptocrack.de> | 2011-11-02 18:31:10 +0100 |
commit | 9aa9fde504fa3a05fcad04d6db086806ac8830c7 (patch) | |
tree | e0534b7902bd8a4698600b184af63d58cf60605d | |
parent | 2bf02493385ffe5e51b5480e57f9643bc80b8267 (diff) | |
download | calcurse-9aa9fde504fa3a05fcad04d6db086806ac8830c7.zip |
src/recur.c: Speed up recur_item_find_occurrence()
Bail out early if we check for a date beyond the item's repetition end
date.
Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
-rw-r--r-- | src/recur.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/recur.c b/src/recur.c index 4c27d91..87e4e36 100644 --- a/src/recur.c +++ b/src/recur.c @@ -636,6 +636,9 @@ recur_item_find_occurrence (long item_start, long item_dur, llist_t *item_exc, if (day_start < item_start - DAYINSEC + 1) return 0; + if (rpt_until != 0 && day_start >= rpt_until + item_dur) + return 0; + t = day_start; lt_day = *localtime (&t); |