Locations in score.
This commit is contained in:
parent
7f8c7710e0
commit
cb6e0ebab4
|
@ -1071,11 +1071,23 @@ void scan_score_graph(struct scan *const scan) {
|
||||||
line = linemap_tree_key(&it);
|
line = linemap_tree_key(&it);
|
||||||
assert(*linemap_tree_value(&it) < scan->scores.array.size);
|
assert(*linemap_tree_value(&it) < scan->scores.array.size);
|
||||||
score = scan->scores.array.data + *linemap_tree_value(&it);
|
score = scan->scores.array.data + *linemap_tree_value(&it);
|
||||||
|
/* Get a place. */
|
||||||
|
struct linemap_tree_iterator place_it
|
||||||
|
= linemap_tree_less(&scan->places.dates, line);
|
||||||
|
struct pair place_name;
|
||||||
|
if(!linemap_tree_has_element(&place_it)) {
|
||||||
|
place_name = (struct pair){ 0, 0 };
|
||||||
|
} else {
|
||||||
|
assert(*linemap_tree_value(&place_it) < scan->places.array.size);
|
||||||
|
place_name
|
||||||
|
= scan->places.array.data[*linemap_tree_value(&place_it)].name;
|
||||||
|
}
|
||||||
char datestr[12];
|
char datestr[12];
|
||||||
date32_to_string(line.date, &datestr);
|
date32_to_string(line.date, &datestr);
|
||||||
score->score++;
|
score->score++; /* Keep track of the score per key. */
|
||||||
printf("%s, %.*s, %u\n", datestr,
|
printf("%s, %.*s, %u, %.*s\n", datestr,
|
||||||
(int)(score->key.b - score->key.a), score->key.a, score->score);
|
(int)(score->key.b - score->key.a), score->key.a, score->score,
|
||||||
|
(int)(place_name.b - place_name.a), place_name.a);
|
||||||
}
|
}
|
||||||
printf("EOD\n"
|
printf("EOD\n"
|
||||||
"# theozh https://stackoverflow.com/a/75466214/2472827\n"
|
"# theozh https://stackoverflow.com/a/75466214/2472827\n"
|
||||||
|
|
Loading…
Reference in New Issue