From c4f6e952bcacdafd4c5d9bd18a796f9eed3aaa9c Mon Sep 17 00:00:00 2001 From: dymik739 Date: Wed, 26 Apr 2023 12:44:39 +0300 Subject: [PATCH] auto-schedule-pro: replace loops with remainder operation to increase performance when looking up large amounts of days --- modules/auto-schedule-pro/index.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/modules/auto-schedule-pro/index.py b/modules/auto-schedule-pro/index.py index 5950cce..c82f1ae 100644 --- a/modules/auto-schedule-pro/index.py +++ b/modules/auto-schedule-pro/index.py @@ -177,10 +177,7 @@ if self.MESSAGE["text"].lower().split()[0] == "!пари": print(f"[auto-schedule-pro:error] Got exception '{e}' while parsing {command[1]}") # keeping day in bounds - while selected_day > 13: - selected_day -= 14 - while selected_day < 0: - selected_day += 14 + selected_day = selected_day % 14 if len(command) > 2: for i in command[2:]: