Simplify chained comparisions

This commit is contained in:
Luflosi
2019-06-05 15:21:01 +02:00
parent 303711ab8d
commit 4eed8463b3
4 changed files with 5 additions and 5 deletions

View File

@@ -88,7 +88,7 @@ def set_font_family(opts=None, override_font_size=None, debug_font_matching=Fals
def add_line(buf, cell_width, position, thickness, cell_height):
y = position - thickness // 2
while thickness > 0 and y > -1 and y < cell_height:
while thickness > 0 and -1 < y < cell_height:
thickness -= 1
ctypes.memset(ctypes.addressof(buf) + (cell_width * y), 255, cell_width)
y += 1