From 803da9645f735edd3d1a80a3f920039e0f0298f2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 11 Aug 2025 11:48:34 -0500 Subject: [PATCH] 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 --- extmod/modframebuf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/extmod/modframebuf.c b/extmod/modframebuf.c index 16606109cc..593125aa16 100644 --- a/extmod/modframebuf.c +++ b/extmod/modframebuf.c @@ -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) {