diff options
author | Oleg Korsak <kamikaze.is.waiting.you@gmail.com> | 2017-01-07 22:03:51 +0200 |
---|---|---|
committer | Oleg Korsak <kamikaze.is.waiting.you@gmail.com> | 2017-01-08 20:16:17 +0200 |
commit | e45035db5c297190eee18cefa3b91b36b9f0e32b (patch) | |
tree | c77aff72bd188f2a79955d0b0596903f28ba8b4c /extmod/modframebuf.c | |
parent | 65cadbeb9d78bfc80314ff4f19fdb4aff5e78244 (diff) |
extmod/modframebuf: optimize fill_rect subroutine call
Diffstat (limited to 'extmod/modframebuf.c')
-rw-r--r-- | extmod/modframebuf.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/extmod/modframebuf.c b/extmod/modframebuf.c index d6e686e07..93d4922c9 100644 --- a/extmod/modframebuf.c +++ b/extmod/modframebuf.c @@ -115,7 +115,7 @@ static inline uint32_t getpixel(const mp_obj_framebuf_t *fb, int x, int y) { } STATIC void fill_rect(const mp_obj_framebuf_t *fb, int x, int y, int w, int h, uint32_t col) { - if (x + w <= 0 || y + h <= 0 || y >= fb->height || x >= fb->width) { + if (h < 1 || w < 1 || x + w <= 0 || y + h <= 0 || y >= fb->height || x >= fb->width) { // No operation needed. return; } |