From: Steinar H. Gunderson Date: Sat, 13 Dec 2014 14:29:52 +0000 (+0100) Subject: Fix a field ordering messup caused by the memory saving changes. X-Git-Url: https://git.sesse.net/?p=remoteglot-book;a=commitdiff_plain;h=99e8e99517d82bd2dc42a9fe104e40e61fe54b82 Fix a field ordering messup caused by the memory saving changes. --- diff --git a/binloader.cpp b/binloader.cpp index 272fc30..4408885 100644 --- a/binloader.cpp +++ b/binloader.cpp @@ -132,8 +132,18 @@ int main(int argc, char **argv) move[l] = 0; int bucket = hash_key_to_bucket(bpfen, bpfen_len, num_buckets); - elems[bucket].emplace_back(Element {bpfen, bpfen_len, {}, Result(r), opening_num, white_elo, black_elo, timestamp, file_num, start_position}); - strcpy(elems[bucket].back().move, move); + Element e; + e.bpfen = bpfen; + e.bpfen_len = bpfen_len; + strcpy(e.move, move); + e.result = Result(r); + e.opening_num = opening_num; + e.white_elo = white_elo; + e.black_elo = black_elo; + e.file_num = file_num; + e.timestamp = timestamp; + e.start_position = start_position; + elems[bucket].push_back(e); ++num_elems; } fclose(fp);