const uint8_t *key, *val;
size_t len_key, len_val;
- while (mtbl_iter_next(it, &key, &len_key, &val, &len_val)) {
+ if (mtbl_iter_next(it, &key, &len_key, &val, &len_val)) {
Count c;
c.ParseFromArray(val, len_val);
- printf("%d %d %d %u %f %f %d %ld %ld",
+ printf("%d %d %d %u %f %f %d %ld %d %ld",
c.white(), c.draw(), c.black(), c.opening_num(),
double(c.sum_white_elo()) / c.num_elo(),
double(c.sum_black_elo()) / c.num_elo(),
c.num_elo(), c.first_timestamp(),
+ c.pgn_file_num(),
c.pgn_start_position());
for (int j = 0; j < c.move_size(); ++j) {
printf(" %s", c.move(j).c_str());
}
printf("\n");
+ } else {
+ printf("-\n");
}
fflush(stdout);
mtbl_iter_destroy(&it);