Skip to content

Commit a8bd524

Browse files
authored
Minor tweek to round_robin.py
1 parent b58c20a commit a8bd524

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scheduling/round_robin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def calculate_waiting_times(burst_times: List[int]) -> List[int]:
2323
rem_burst_times = list(burst_times)
2424
waiting_times = [0] * len(burst_times)
2525
t = 0
26-
while 1:
26+
while True:
2727
done = True
2828
for i, burst_time in enumerate(burst_times):
2929
if rem_burst_times[i] > 0:
@@ -33,7 +33,7 @@ def calculate_waiting_times(burst_times: List[int]) -> List[int]:
3333
rem_burst_times[i] -= quantum
3434
else:
3535
t += rem_burst_times[i]
36-
waiting_times[i] = t - burst_times[i]
36+
waiting_times[i] = t - burst_time
3737
rem_burst_times[i] = 0
3838
if done is True:
3939
return waiting_times

0 commit comments

Comments
 (0)