Skip to content

Commit bfc6140

Browse files
committed
Optimize display height assignment
1 parent f5b3367 commit bfc6140

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

adafruit_fruitjam/peripherals.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ def request_display_config(width=None, height=None, color_depth=None):
8585

8686
# if user does not specify height, use matching height
8787
if height is None:
88-
for size in VALID_DISPLAY_SIZES:
89-
if width == size[0]:
90-
height = size[1]
88+
height = next((h for w, h in VALID_DISPLAY_SIZES if width == w))
9189

9290
# if user does not specify a requested color_depth
9391
if color_depth is None:

0 commit comments

Comments
 (0)