commit aca784d0f69d9c2ee7923c96181b6c5cc2d76355 from: Mark Jamsek date: Mon Jan 06 01:31:48 2025 UTC use got_object_id_queue_free() instead of hand-rolled code ok stsp@ commit - 79917dd6184d9c4e2b1f4e49aa89339cc475c3d0 commit + aca784d0f69d9c2ee7923c96181b6c5cc2d76355 blob - b8e1d37587798c64a9b4aa32a9e41a81d15c4cf3 blob + 7ff4453eb37231d259aac420e9ab90fcd3615847 --- cvg/cvg.c +++ cvg/cvg.c @@ -3913,11 +3913,7 @@ print_commits(struct got_object_id *root_id, struct go } } done: - while (!STAILQ_EMPTY(&reversed_commits)) { - qid = STAILQ_FIRST(&reversed_commits); - STAILQ_REMOVE_HEAD(&reversed_commits, entry); - got_object_qid_free(qid); - } + got_object_id_queue_free(&reversed_commits); got_pathlist_free(&changed_paths, GOT_PATHLIST_FREE_ALL); if (search_pattern) regfree(®ex); blob - 4f9a936005900e7b54a3fd696424a48a92a1d262 blob + db6129ef317c31225f7da933b72b257309f299aa --- got/got.c +++ got/got.c @@ -4691,11 +4691,7 @@ print_commits(struct got_object_id *root_id, struct go } } done: - while (!STAILQ_EMPTY(&reversed_commits)) { - qid = STAILQ_FIRST(&reversed_commits); - STAILQ_REMOVE_HEAD(&reversed_commits, entry); - got_object_qid_free(qid); - } + got_object_id_queue_free(&reversed_commits); got_pathlist_free(&changed_paths, GOT_PATHLIST_FREE_ALL); if (search_pattern) regfree(®ex); blob - 8f92913331bd60b19ef2fd111b33c55e075f4a01 blob + 12d6d0ad06ab75d791a22ba785294f8321da89df --- gotd/repo_write.c +++ gotd/repo_write.c @@ -1955,11 +1955,7 @@ print_commits(struct got_object_id *root_id, struct go done: if (commit) got_object_commit_close(commit); - while (!STAILQ_EMPTY(&reversed_commits)) { - qid = STAILQ_FIRST(&reversed_commits); - STAILQ_REMOVE_HEAD(&reversed_commits, entry); - got_object_qid_free(qid); - } + got_object_id_queue_free(&reversed_commits); got_pathlist_free(&changed_paths, GOT_PATHLIST_FREE_ALL); got_commit_graph_close(graph); return err; blob - b2aff124e338ed8deeec832452d7057689f7d5eb blob + da3af395b2dbac57ee04e516108f32c3ee9ba1cd --- tog/tog.c +++ tog/tog.c @@ -8379,12 +8379,7 @@ close_blame_view(struct tog_view *view) if (s->blame.thread) err = stop_blame(&s->blame); - while (!STAILQ_EMPTY(&s->blamed_commits)) { - struct got_object_qid *blamed_commit; - blamed_commit = STAILQ_FIRST(&s->blamed_commits); - STAILQ_REMOVE_HEAD(&s->blamed_commits, entry); - got_object_qid_free(blamed_commit); - } + got_object_id_queue_free(&s->blamed_commits); if (using_mock_io) { struct tog_blame_thread_args *bta = &s->blame.thread_args;