summaryrefslogtreecommitdiff
path: root/commit-reach.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-12-27 11:46:22 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-27 08:11:15 -0800
commit95c09e4d07492fa9e4ad951a268b4ea6bae69038 (patch)
treefd5cdd5c33cacdb2b1c34f4d8816769919645168 /commit-reach.c
parent44945dfe867e56aab1685a0f371665273291a2af (diff)
commit-reach: fix index used to loop through unsigned integer
In 62e745ced2 (prio-queue: use size_t rather than int for size, 2024-12-20), we refactored `struct prio_queue` to track the number of contained entries via a `size_t`. While the refactoring adapted one of the users of that variable, it forgot to also adapt "commit-reach.c" accordingly. This was missed because that file has -Wsign-conversion disabled. Fix the issue by using a `size_t` to iterate through entries. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-reach.c')
-rw-r--r--commit-reach.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/commit-reach.c b/commit-reach.c
index e3edd11995..e658726170 100644
--- a/commit-reach.c
+++ b/commit-reach.c
@@ -42,8 +42,7 @@ static int compare_commits_by_gen(const void *_a, const void *_b)
static int queue_has_nonstale(struct prio_queue *queue)
{
- int i;
- for (i = 0; i < queue->nr; i++) {
+ for (size_t i = 0; i < queue->nr; i++) {
struct commit *commit = queue->array[i].data;
if (!(commit->object.flags & STALE))
return 1;