Skip to content

Commit 87f4cd6

Browse files
FoamyGuytannewt
andauthored
return expression instead of if statement
Co-authored-by: Scott Shawcroft <[email protected]>
1 parent db31872 commit 87f4cd6

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

shared-module/displayio/TileGrid.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,8 @@ void common_hal_displayio_tilegrid_set_transpose_xy(displayio_tilegrid_t *self,
345345
bool common_hal_displayio_tilegrid_contains(displayio_tilegrid_t *self, uint16_t x, uint16_t y) {
346346
uint16_t right_edge = self->x + (self->width_in_tiles * self->tile_width);
347347
uint16_t bottom_edge = self->y + (self->height_in_tiles * self->tile_height);
348-
if (x >= self->x && x <= right_edge &&
349-
y >= self->y && y <= bottom_edge) {
350-
return true;
351-
} else {
352-
return false;
353-
}
348+
return x >= self->x && x <= right_edge &&
349+
y >= self->y && y <= bottom_edge;
354350
}
355351

356352
void common_hal_displayio_tilegrid_set_top_left(displayio_tilegrid_t *self, uint16_t x, uint16_t y) {

0 commit comments

Comments
 (0)