From 2d08c97ae27b41be977b3a5ac8ff74415ed6d147 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 16 May 2020 10:32:27 +0200 Subject: [PATCH] CalendarEvent - compute_next_value: use change tracking to avoid repeated testing --- src/tools/systemd/time.rs | 24 ++++++++++++++++-------- src/tools/systemd/tm_editor.rs | 2 +- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/tools/systemd/time.rs b/src/tools/systemd/time.rs index b16e3a37..5a71c4ed 100644 --- a/src/tools/systemd/time.rs +++ b/src/tools/systemd/time.rs @@ -157,10 +157,12 @@ pub fn compute_next_event( count += 1; } - if !all_days { // match day first + if !all_days && t.changes.contains(TMChanges::WDAY) { // match day first let day_num = t.day_num(); let day = WeekDays::from_bits(1< bool {