Book: simplify WriteData.
authorYann Dirson <ydirson@free.fr>
Fri, 21 Feb 2014 21:20:35 +0000 (22:20 +0100)
committerYann Dirson <ydirson@free.fr>
Sat, 22 Feb 2014 09:46:23 +0000 (10:46 +0100)
gnushogi/book.c

index 0e95607..cc5630a 100644 (file)
@@ -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)