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

Dominik Csapak d.csapak at proxmox.com
Thu Sep 3 13:39:52 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 edf26505..a6db8a92 100644
--- a/src/tools/systemd/time.rs
+++ b/src/tools/systemd/time.rs
@@ -183,12 +183,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;
             }
         }
 
@@ -201,12 +200,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;
             }
         }
 
@@ -219,12 +217,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;
             }
         }
 
@@ -237,12 +234,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