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/checkout.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/checkout.c')
-rw-r--r-- | src/checkout.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/checkout.c b/src/checkout.c index 4305d3e9a..e33ac2ed6 100644 --- a/src/checkout.c +++ b/src/checkout.c @@ -846,7 +846,7 @@ static int checkout_conflicts_coalesce_renames( /* Juggle entries based on renames */ names = git_index_name_entrycount(data->index); - + for (i = 0; i < names; i++) { name_entry = git_index_name_get_byindex(data->index, i); @@ -1760,9 +1760,6 @@ static int checkout_create_conflicts(checkout_data *data) static void checkout_data_clear(checkout_data *data) { - checkout_conflictdata *conflict; - size_t i; - if (data->opts_free_baseline) { git_tree_free(data->opts.baseline); data->opts.baseline = NULL; @@ -1771,10 +1768,7 @@ static void checkout_data_clear(checkout_data *data) git_vector_free(&data->removes); git_pool_clear(&data->pool); - git_vector_foreach(&data->conflicts, i, conflict) - git__free(conflict); - - git_vector_free(&data->conflicts); + git_vector_free_all(&data->conflicts); git__free(data->pfx); data->pfx = NULL; |