Skip to content

Commit e45035d

Browse files
committed
extmod/modframebuf: optimize fill_rect subroutine call
1 parent 65cadbe commit e45035d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

extmod/modframebuf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ static inline uint32_t getpixel(const mp_obj_framebuf_t *fb, int x, int y) {
115115
}
116116

117117
STATIC void fill_rect(const mp_obj_framebuf_t *fb, int x, int y, int w, int h, uint32_t col) {
118-
if (x + w <= 0 || y + h <= 0 || y >= fb->height || x >= fb->width) {
118+
if (h < 1 || w < 1 || x + w <= 0 || y + h <= 0 || y >= fb->height || x >= fb->width) {
119119
// No operation needed.
120120
return;
121121
}

0 commit comments

Comments
 (0)