From 177a8915a47849298740bc7b772e9677d698b1af Mon Sep 17 00:00:00 2001 From: tb Date: Fri, 13 Aug 2021 10:45:26 +0000 Subject: [PATCH] Simplify an if clause using De Morgan's law. Using the fact that since r1.53 prec is always non-negative and that r1.50 added an initialization of use_unif, we can eliminate a couple of lines and make the intention clearer. ok martijn --- usr.bin/jot/jot.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/usr.bin/jot/jot.c b/usr.bin/jot/jot.c index fd686d40a6e..e5d3f96bede 100644 --- a/usr.bin/jot/jot.c +++ b/usr.bin/jot/jot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: jot.c,v 1.53 2021/08/13 10:40:23 tb Exp $ */ +/* $OpenBSD: jot.c,v 1.54 2021/08/13 10:45:26 tb Exp $ */ /* $NetBSD: jot.c,v 1.3 1994/12/02 20:29:43 pk Exp $ */ /*- @@ -258,9 +258,7 @@ main(int argc, char *argv[]) } x = ender - begin; - if (prec == 0 && (fmod(ender, 1) != 0 || fmod(begin, 1) != 0)) - use_unif = 0; - else { + if (prec > 0 || (fmod(ender, 1) == 0 && fmod(begin, 1) == 0)) { double range; while (prec-- > 0) -- 2.20.1