From 8ea8350f9052b02a54fc2a56a50caf9360268f99 Mon Sep 17 00:00:00 2001 From: Frederic Cambus Date: Fri, 17 Jul 2020 07:58:47 +0000 Subject: Merge the two if blocks checking if the font in use contains a given character in rasops_mapchar(). OK kn@, cheloha@ --- sys/dev/rasops/rasops.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'sys/dev/rasops') diff --git a/sys/dev/rasops/rasops.c b/sys/dev/rasops/rasops.c index 87dbe409d95..b0b14765df3 100644 --- a/sys/dev/rasops/rasops.c +++ b/sys/dev/rasops/rasops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rasops.c,v 1.63 2020/07/11 15:02:52 fcambus Exp $ */ +/* $OpenBSD: rasops.c,v 1.64 2020/07/17 07:58:46 fcambus Exp $ */ /* $NetBSD: rasops.c,v 1.35 2001/02/02 06:01:01 marcus Exp $ */ /*- @@ -532,13 +532,8 @@ rasops_mapchar(void *cookie, int c, u_int *cp) } } - - if (c < ri->ri_font->firstchar) { - *cp = '?'; - return (0); - } - - if (c - ri->ri_font->firstchar >= ri->ri_font->numchars) { + if (c < ri->ri_font->firstchar || + c - ri->ri_font->firstchar >= ri->ri_font->numchars) { *cp = '?'; return (0); } -- cgit v1.2.3