auto-schedule-pro: replace loops with remainder operation to increase performance when looking up large amounts of days

This commit is contained in:
dymik739 2023-04-26 12:44:39 +03:00
parent 759b7517ef
commit c4f6e952bc
1 changed files with 1 additions and 4 deletions

View File

@ -177,10 +177,7 @@ if self.MESSAGE["text"].lower().split()[0] == "!пари":
print(f"[auto-schedule-pro:error] Got exception '{e}' while parsing {command[1]}") print(f"[auto-schedule-pro:error] Got exception '{e}' while parsing {command[1]}")
# keeping day in bounds # keeping day in bounds
while selected_day > 13: selected_day = selected_day % 14
selected_day -= 14
while selected_day < 0:
selected_day += 14
if len(command) > 2: if len(command) > 2:
for i in command[2:]: for i in command[2:]: