extmod/modframebuf: Save code size in setpixel.
There's a slight code size increase paid for by using setpixel_checked for the last pixel of a line, instead of repeating the checks inline. Signed-off-by: Jeff Epler <jepler@gmail.com>
This commit is contained in:
parent
e15219800e
commit
803da9645f
1 changed files with 1 additions and 3 deletions
|
|
@ -483,9 +483,7 @@ static void line(const mp_obj_framebuf_t *fb, mp_int_t x1, mp_int_t y1, mp_int_t
|
|||
e += 2 * dy;
|
||||
}
|
||||
|
||||
if (0 <= x2 && x2 < fb->width && 0 <= y2 && y2 < fb->height) {
|
||||
setpixel(fb, x2, y2, col);
|
||||
}
|
||||
setpixel_checked(fb, x2, y2, col, 1);
|
||||
}
|
||||
|
||||
static mp_obj_t framebuf_line(size_t n_args, const mp_obj_t *args_in) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue