Modify remove_overwrap

This commit is contained in:
taizan-hokuto
2020-01-26 14:21:18 +09:00
parent 03b901d59c
commit 5ba61db4f3

View File

@@ -128,22 +128,19 @@ class Downloader:
jmp = False jmp = False
ret.append(blocks[0]) ret.append(blocks[0])
while a < len(blocks)-2: while a < len(blocks)-2:
while is_overwrap(a,b): while is_overwrap(a,b):
b+=1 b+=1
if b == len(blocks)-1: if b == len(blocks)-1:
jmp=True jmp = True
break break
if jmp: break if jmp: break
if b-a == 1: if b-a == 1:
ret.append(blocks[b])
a = b a = b
b+=1
continue
else: else:
ret.append(blocks[b-1]) a = b-1
a=b-1 ret.append(blocks[a])
b=a+1 b = a+1
ret.append(blocks[-1]) ret.append(blocks[-1])
self.blocks = ret self.blocks = ret
return self return self