Skip to content

Commit d57a2fa

Browse files
committed
fixup! survey: add ability to track prioritized lists
1 parent 648dc1c commit d57a2fa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

builtin/survey.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,9 @@ static void maybe_insert_into_top_size(struct survey_report_top_table *top,
176176
else
177177
top->nr++;
178178

179-
for (size_t i = top->nr - 1; i > pos; i--)
180-
memcpy(&sz_array[i], &sz_array[i - 1], sizeof(*sz_array));
181-
182-
memcpy(&sz_array[pos], summary, sizeof(*summary));
179+
memmove(sz_array + pos + 1, sz_array + pos,
180+
(top->nr - pos - 1) * sizeof(*sz_array));
181+
memcpy(sz_array + pos, summary, sizeof(*summary));
183182
sz_array[pos].label = xstrdup(summary->label);
184183
}
185184

0 commit comments

Comments
 (0)