]> git.sesse.net Git - pgn-extract/commitdiff
Store the move as part of the value now, not the key. Means better transposition...
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 12 Dec 2014 01:07:54 +0000 (02:07 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 12 Dec 2014 21:56:56 +0000 (22:56 +0100)
output.c

index bc19a4a84894e7e0801c363d5ada0f6c734ca7f2..a17d5b1653cc54c86cc19728560130676478f222 100644 (file)
--- a/output.c
+++ b/output.c
@@ -1232,9 +1232,8 @@ output_sesse_bin_game(Game current_game,FILE *outputfile,
         unsigned int opening = move->eco ? move->eco->cumulative_hash_value : 0;  // Truncate to 32 bits.
 
         // key
-        putc(move->bpfen_len + strlen((char *)move->move), outputfile);
+        putc(move->bpfen_len, outputfile);
         fwrite(move->bpfen, move->bpfen_len, 1, outputfile);
-        fwrite(move->move, strlen((char *)move->move), 1, outputfile);
 
         // value
         putc(result_int, outputfile);
@@ -1242,6 +1241,8 @@ output_sesse_bin_game(Game current_game,FILE *outputfile,
         fwrite(&black_elo, sizeof(black_elo), 1, outputfile);
         fwrite(&opening, sizeof(opening), 1, outputfile);
         fwrite(&timestamp, sizeof(timestamp), 1, outputfile);
+        putc(strlen((char *)move->move), outputfile);
+        fwrite(move->move, strlen((char *)move->move), 1, outputfile);
     }
 }