[pbs-devel] [PATCH proxmox-backup v2 03/11] tools/systemd/time: move continue out of the if/else

Dominik Csapak d.csapak at proxmox.com
Fri Sep 4 14:33:26 CEST 2020


will be called anyway

Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
---
 src/tools/systemd/time.rs | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/tools/systemd/time.rs b/src/tools/systemd/time.rs
index 0d114eb8..8bb2a8f7 100644
--- a/src/tools/systemd/time.rs
+++ b/src/tools/systemd/time.rs
@@ -181,12 +181,11 @@ pub fn compute_next_event(
                 {
                     // try next day
                     t.add_days(n - day_num, true)?;
-                    continue;
                 } else {
                     // try next week
                     t.add_days(7 - day_num, true)?;
-                    continue;
                 }
+                continue;
             }
         }
 
@@ -197,12 +196,11 @@ pub fn compute_next_event(
                 if let Some(n) = DateTimeValue::find_next(&event.hour, hour) {
                     // test next hour
                     t.set_time(n as libc::c_int, 0, 0)?;
-                    continue;
                 } else {
                     // test next day
                     t.add_days(1, true)?;
-                    continue;
                 }
+                continue;
             }
         }
 
@@ -213,12 +211,11 @@ pub fn compute_next_event(
                 if let Some(n) = DateTimeValue::find_next(&event.minute, minute) {
                     // test next minute
                     t.set_min_sec(n as libc::c_int, 0)?;
-                    continue;
                 } else {
                     // test next hour
                     t.set_time(t.hour() + 1, 0, 0)?;
-                    continue;
                 }
+                continue;
             }
         }
 
@@ -229,12 +226,11 @@ pub fn compute_next_event(
                 if let Some(n) = DateTimeValue::find_next(&event.second, second) {
                     // test next second
                     t.set_sec(n as libc::c_int)?;
-                    continue;
                 } else {
                     // test next min
                     t.set_min_sec(t.min() + 1, 0)?;
-                    continue;
                 }
+                continue;
             }
         }
 
-- 
2.20.1






More information about the pbs-devel mailing list