Refactor unnecessary else / elif when if block has a return statement

This commit is contained in:
deepsource-autofix[bot]
2021-04-09 23:30:53 +00:00
committed by GitHub
parent 86ae06de51
commit bd2a63653b
19 changed files with 52 additions and 70 deletions

View File

@@ -59,10 +59,9 @@ class Base62:
out += bytes([0])
return self.reverse(out)
elif len(out) > estimated_length:
if len(out) > estimated_length:
return self.reverse(out[:estimated_length])
else:
return self.reverse(out)
return self.reverse(out)
def estimate_output_length(self, input_length: int, source_base: int,
target_base: int):

View File

@@ -30,8 +30,7 @@ class Utils:
fmt = '%%0%dx' % (width // 4)
if i == 0:
return bytes([0])
else:
return binascii.unhexlify(fmt % i)
return binascii.unhexlify(fmt % i)
@staticmethod
def bytes_to_hex(buffer: bytes) -> str: