Permalink
Browse files

extmod/modframebuf: optimize fill_rect subroutine call

  • Loading branch information...
1 parent 65cadbe commit e45035db5c297190eee18cefa3b91b36b9f0e32b @kamikaze kamikaze committed Jan 7, 2017
Showing with 1 addition and 1 deletion.
  1. +1 −1 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;
}

0 comments on commit e45035d

Please sign in to comment.