changeset 1853:c92e1d047596

Simplify.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 01 Nov 2017 12:55:39 +0200
parents 83474d274310
children 956b12841624
files diffmap.c
diffstat 1 files changed, 2 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/diffmap.c	Wed Nov 01 12:55:07 2017 +0200
+++ b/diffmap.c	Wed Nov 01 12:55:39 2017 +0200
@@ -158,20 +158,14 @@
                 !muStrChr((unsigned char *) filter2, nfilter2, *p2))
             {
                 c = muGetMapPieceIndex(*p2, useOld, FALSE);
-                if (c < 0)
-                    *pd = 0xfd;
-                else
-                    *pd = c | 64;
+                *pd = (c < 0) ? 0xfd : (c | 64);
                 THMSG(2, "[%d,%d]: %d -> %d\n", x+1, y+1, *p1, *p2);
                 (*count)++;
             }
             else
             {
                 c = muGetMapPieceIndex(*p1, useOld, FALSE);
-                if (c < 0)
-                    *pd = 0xfd;
-                else
-                    *pd = c;
+                *pd = (c < 0) ? 0xfd : c;
             }
 
             p1++;