From: Yann Dirson Date: Fri, 21 Feb 2014 21:20:35 +0000 (+0100) Subject: Book: simplify WriteData. X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=be8ade49e000316ba880ea95f5940cec7693f7ce;p=gnushogi.git Book: simplify WriteData. --- diff --git a/gnushogi/book.c b/gnushogi/book.c index 0e95607..cc5630a 100644 --- a/gnushogi/book.c +++ b/gnushogi/book.c @@ -598,12 +598,12 @@ static void WriteAdmin(void) static void WriteData(int *mustwrite) { - if (*mustwrite) - { - lseek(gfd, currentoffset, SEEK_SET); - write(gfd, (char *)&DATA, sizeof_gdxdata); - *mustwrite = false; - } + if (!*mustwrite) + return; + + lseek(gfd, currentoffset, SEEK_SET); + write(gfd, (char *)&DATA, sizeof_gdxdata); + *mustwrite = false; } static int ReadAdmin(void)