From 51476a384daabaa6e2700859d2e4863ec7ca0284 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Wed, 29 Jan 2020 20:09:27 +0100 Subject: [PATCH] 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 --- lib/bup/vint.py | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) 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: -- 2.39.2