c->white = c0->white + c1->white;
c->draw = c0->draw + c1->draw;
c->black = c0->black + c1->black;
- c->opening_num = c0->opening_num; // Arbitrary choice.
c->sum_white_elo = c0->sum_white_elo + c1->sum_white_elo;
c->sum_black_elo = c0->sum_black_elo + c1->sum_black_elo;
c->num_elo = c0->num_elo + c1->num_elo;
+ if (c0->first_timestamp <= c1->first_timestamp) {
+ c->opening_num = c0->opening_num;
+ c->first_timestamp = c0->first_timestamp;
+ } else {
+ c->opening_num = c1->opening_num;
+ c->first_timestamp = c1->first_timestamp;
+ }
*merged_val = reinterpret_cast<uint8_t *>(c.release());
*len_merged_val = sizeof(Count);