Updating scheduling/split_workload.py

implementing recommendations

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
This commit is contained in:
Margaret 2023-07-26 17:07:39 +03:00 committed by GitHub
parent d7437a22b6
commit f12ae10b43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,9 +28,9 @@ def split_list(timings: list) -> tuple:
def split_workload(arr: list) -> tuple: def split_workload(arr: list) -> tuple:
if len(arr) == 0: if len(arr) == 0:
result = ([], [], 0) return ([], [], 0)
elif len(arr) == 1: if len(arr) == 1:
result = ([arr[0]], [], 1) return ([arr[0]], [], 1)
else: else:
n = len(arr) n = len(arr)
smallest_diff = float("inf") smallest_diff = float("inf")