Skip to content

Commit 42c240d

Browse files
committed
support machine that have two cpu core or less
1 parent b33acc2 commit 42c240d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

scan.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515

1616
def split_list(total: int, num_splits: int) -> list:
17+
if num_splits <= 1:
18+
return [[0, total]]
1719
split_size = total // num_splits
1820
split_list = [[i * split_size + 1, (i + 1) * split_size]
1921
for i in range(num_splits - 1)]

0 commit comments

Comments
 (0)