diff options
| author | Russell Belfer <rb@github.com> | 2013-12-06 15:04:31 -0800 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2013-12-11 10:57:49 -0800 |
| commit | fcd324c625d8be3f368c924d787e945e5812d8dd (patch) | |
| tree | ac1e54b2538cdc10ee17dfd7c887c35dd1f572bf /src/status.c | |
| parent | dab89f9b6821b67dd07c8bd4dbb53e25a3e687c7 (diff) | |
| download | libgit2-fcd324c625d8be3f368c924d787e945e5812d8dd.tar.gz | |
Add git_vector_free_all
There are a lot of places that we call git__free on each item in
a vector and then call git_vector_free on the vector itself. This
just wraps that up into one convenient helper function.
Diffstat (limited to 'src/status.c')
| -rw-r--r-- | src/status.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/status.c b/src/status.c index 777b7964a..ce571a2d8 100644 --- a/src/status.c +++ b/src/status.c @@ -376,19 +376,13 @@ const git_status_entry *git_status_byindex(git_status_list *status, size_t i) void git_status_list_free(git_status_list *status) { - git_status_entry *status_entry; - size_t i; - if (status == NULL) return; git_diff_free(status->head2idx); git_diff_free(status->idx2wd); - git_vector_foreach(&status->paired, i, status_entry) - git__free(status_entry); - - git_vector_free(&status->paired); + git_vector_free_all(&status->paired); git__memzero(status, sizeof(*status)); git__free(status); |
