Skip to content

Commit a5fc86a

Browse files
authored
Merge pull request #22 from grote/patch-1
Fix chunks smaller than min_size in pure python implementation
2 parents d3b9f7f + 3a9ef6c commit a5fc86a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fastcdc/fastcdc_py.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def chunk_generator(stream, min_size, avg_size, max_size, fat, hf):
4545

4646
def cdc_offset(data, mi, av, ma, cs, mask_s, mask_l):
4747
pattern = 0
48-
i = mi
4948
size = len(data)
49+
i = min(mi, size)
5050
barrier = min(cs, size)
5151
while i < barrier:
5252
pattern = (pattern >> 1) + GEAR[data[i]]

0 commit comments

Comments
 (0)