Avoid deadloop when recomputing is triggered.

This commit is contained in:
Xinhao Yuan 2021-09-06 14:49:49 -04:00
parent 09989c71e9
commit df15a7b78e
1 changed files with 2 additions and 1 deletions

View File

@ -36,8 +36,9 @@ local function fair_split(length, shares)
local sum_adj
local remaining = #shares
local spare = nil
local need_recompute = false
local need_recompute
repeat
need_recompute = false
sum_weight = 0
sum_adj = 0
for i = 1, #shares do