Skip to content

Commit

Permalink
fixup! survey: add ability to track prioritized lists
Browse files Browse the repository at this point in the history
  • Loading branch information
dscho committed Sep 26, 2024
1 parent 648dc1c commit d57a2fa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions builtin/survey.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,9 @@ static void maybe_insert_into_top_size(struct survey_report_top_table *top,
else
top->nr++;

for (size_t i = top->nr - 1; i > pos; i--)
memcpy(&sz_array[i], &sz_array[i - 1], sizeof(*sz_array));

memcpy(&sz_array[pos], summary, sizeof(*summary));
memmove(sz_array + pos + 1, sz_array + pos,
(top->nr - pos - 1) * sizeof(*sz_array));
memcpy(sz_array + pos, summary, sizeof(*summary));
sz_array[pos].label = xstrdup(summary->label);
}

Expand Down

0 comments on commit d57a2fa

Please sign in to comment.