mirror of
https://github.com/corundum/corundum.git
synced 2025-01-16 08:12:53 +08:00
Use extend instead of for loop
This commit is contained in:
parent
aebe0549dd
commit
3b0cfbbfed
@ -90,9 +90,8 @@ def cobs_decode(block):
|
||||
i += 1
|
||||
if i+code-1 > len(block):
|
||||
return None
|
||||
for k in range(code-1):
|
||||
dec.append(block[i])
|
||||
i += 1
|
||||
dec.extend(block[i:i+code-1])
|
||||
i += code-1
|
||||
if code < 255 and i < len(block):
|
||||
dec.append(0)
|
||||
|
||||
|
@ -91,9 +91,8 @@ def cobs_decode(block):
|
||||
i += 1
|
||||
if i+code-1 > len(block):
|
||||
return None
|
||||
for k in range(code-1):
|
||||
dec.append(block[i])
|
||||
i += 1
|
||||
dec.extend(block[i:i+code-1])
|
||||
i += code-1
|
||||
if code < 255 and i < len(block):
|
||||
dec.append(0)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user