From be8ade49e000316ba880ea95f5940cec7693f7ce Mon Sep 17 00:00:00 2001 From: Yann Dirson Date: Fri, 21 Feb 2014 22:20:35 +0100 Subject: [PATCH] Book: simplify WriteData. --- gnushogi/book.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) 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) -- 1.7.0.4