--- a/stream-run.py +++ b/stream-run.py @@ -87,7 +87,6 @@ n = int(flags.size) slots_total += n if n == 0: - cur = 0 continue idx = np.flatnonzero(flags) if idx.size == 0: @@ -107,7 +106,7 @@ best = max(best, cur, int(lens.max())) if int(idx[-1]) != n - 1: cur = 0 - else: + elif idx.size != n: cur = last return best, slots_total, span