Skip to content

Commit 1d50f95

Browse files
authored
Merge pull request libgit2#4166 from pks-t/pks/map-free-fix
Remove `map_free` macros
2 parents 3105992 + 94af915 commit 1d50f95

File tree

9 files changed

+9
-15
lines changed

9 files changed

+9
-15
lines changed

src/checkout.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2319,15 +2319,14 @@ static void checkout_data_clear(checkout_data *data)
23192319
git__free(data->pfx);
23202320
data->pfx = NULL;
23212321

2322-
git_strmap_free(data->mkdir_map);
2323-
23242322
git_buf_free(&data->target_path);
23252323
git_buf_free(&data->tmp);
23262324

23272325
git_index_free(data->index);
23282326
data->index = NULL;
23292327

23302328
git_strmap_free(data->mkdir_map);
2329+
data->mkdir_map = NULL;
23312330

23322331
git_attr_session__free(&data->attr_session);
23332332
}

src/idxmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ void git_idxmap_icase_resize(git_idxmap_icase *map, size_t size)
9999
kh_resize(idxicase, map, size);
100100
}
101101

102-
void git_idxmap__free(git_idxmap *map)
102+
void git_idxmap_free(git_idxmap *map)
103103
{
104104
kh_destroy(idx, map);
105105
}

src/idxmap.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ int git_idxmap_has_data(git_idxmap *map, size_t idx);
3939

4040
void git_idxmap_resize(git_idxmap *map, size_t size);
4141
void git_idxmap_icase_resize(git_idxmap_icase *map, size_t size);
42-
#define git_idxmap_free(h) git_idxmap__free(h); (h) = NULL
43-
void git_idxmap__free(git_idxmap *map);
42+
void git_idxmap_free(git_idxmap *map);
4443
void git_idxmap_clear(git_idxmap *map);
4544

4645
void git_idxmap_delete_at(git_idxmap *map, size_t idx);

src/offmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ git_offmap *git_offmap_alloc(void)
1414
return kh_init(off);
1515
}
1616

17-
void git_offmap__free(git_offmap *map)
17+
void git_offmap_free(git_offmap *map)
1818
{
1919
kh_destroy(off, map);
2020
}

src/offmap.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ __KHASH_TYPE(off, git_off_t, void *)
2121
typedef khash_t(off) git_offmap;
2222

2323
git_offmap *git_offmap_alloc(void);
24-
#define git_offmap_free(h) git_offmap__free(h); (h) = NULL
25-
void git_offmap__free(git_offmap *map);
24+
void git_offmap_free(git_offmap *map);
2625
void git_offmap_clear(git_offmap *map);
2726

2827
size_t git_offmap_num_entries(git_offmap *map);

src/oidmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ git_oidmap *git_oidmap_alloc()
2121
return kh_init(oid);
2222
}
2323

24-
void git_oidmap__free(git_oidmap *map)
24+
void git_oidmap_free(git_oidmap *map)
2525
{
2626
kh_destroy(oid, map);
2727
}

src/oidmap.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ __KHASH_TYPE(oid, const git_oid *, void *)
2121
typedef khash_t(oid) git_oidmap;
2222

2323
git_oidmap *git_oidmap_alloc(void);
24-
#define git_oidmap_free(h) git_oidmap__free(h); (h) = NULL
25-
void git_oidmap__free(git_oidmap *map);
24+
void git_oidmap_free(git_oidmap *map);
2625
void git_oidmap_clear(git_oidmap *map);
2726

2827
size_t git_oidmap_size(git_oidmap *map);

src/strmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int git_strmap_alloc(git_strmap **map)
1919
return 0;
2020
}
2121

22-
void git_strmap__free(git_strmap *map)
22+
void git_strmap_free(git_strmap *map)
2323
{
2424
kh_destroy(str, map);
2525
}

src/strmap.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ typedef khash_t(str) git_strmap;
2121
typedef khiter_t git_strmap_iter;
2222

2323
int git_strmap_alloc(git_strmap **map);
24-
25-
#define git_strmap_free(h) git_strmap__free(h); (h) = NULL
26-
void git_strmap__free(git_strmap *map);
24+
void git_strmap_free(git_strmap *map);
2725
void git_strmap_clear(git_strmap *map);
2826

2927
size_t git_strmap_num_entries(git_strmap *map);

0 commit comments

Comments
 (0)