From: Johannes Berg Date: Wed, 29 Jan 2020 19:09:27 +0000 (+0100) Subject: vint: remove unnecessary condition X-Git-Tag: 0.31~169 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=bup.git;a=commitdiff_plain;h=51476a384daabaa6e2700859d2e4863ec7ca0284 vint: remove unnecessary condition "if c:" can never be false, since we checked before. Remove the extra condition. Signed-off-by: Johannes Berg Reviewed-by: Rob Browning Tested-by: Rob Browning --- diff --git a/lib/bup/vint.py b/lib/bup/vint.py index 143e5b6..086cb30 100644 --- a/lib/bup/vint.py +++ b/lib/bup/vint.py @@ -85,18 +85,17 @@ def read_vint(port): result = 0 offset = 0 # Handle first byte with sign bit specially. - if c: - b = ord(c) - if b & 0x40: - negative = True - result |= (b & 0x3f) - if b & 0x80: - offset += 6 - c = port.read(1) - elif negative: - return -result - else: - return result + b = ord(c) + if b & 0x40: + negative = True + result |= (b & 0x3f) + if b & 0x80: + offset += 6 + c = port.read(1) + elif negative: + return -result + else: + return result while True: b = ord(c) if b & 0x80: