mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-04 23:57:33 +00:00
attrcache: remove useless do_init
indirection
Remove useless indirection from `git_attr_cache__init` to `git_attr_cache__do_init`. The difference is that the `git_attr_cache__init` macro first checks if the cache is already initialized and, if so, not call `git_attr_cache__do_init`. But actually, `git_attr_cache__do_init` already does the same thing and returns immediately if the cache is already initialized. Remove the indirection.
This commit is contained in:
parent
c11510103d
commit
ce6f61daf0
@ -354,7 +354,7 @@ static void attr_cache__free(git_attr_cache *cache)
|
|||||||
git__free(cache);
|
git__free(cache);
|
||||||
}
|
}
|
||||||
|
|
||||||
int git_attr_cache__do_init(git_repository *repo)
|
int git_attr_cache__init(git_repository *repo)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
git_attr_cache *cache = git_repository_attr_cache(repo);
|
git_attr_cache *cache = git_repository_attr_cache(repo);
|
||||||
|
@ -22,10 +22,7 @@ typedef struct {
|
|||||||
git_pool pool;
|
git_pool pool;
|
||||||
} git_attr_cache;
|
} git_attr_cache;
|
||||||
|
|
||||||
extern int git_attr_cache__do_init(git_repository *repo);
|
extern int git_attr_cache__init(git_repository *repo);
|
||||||
|
|
||||||
#define git_attr_cache__init(REPO) \
|
|
||||||
(git_repository_attr_cache(REPO) ? 0 : git_attr_cache__do_init(REPO))
|
|
||||||
|
|
||||||
/* get file - loading and reload as needed */
|
/* get file - loading and reload as needed */
|
||||||
extern int git_attr_cache__get(
|
extern int git_attr_cache__get(
|
||||||
|
Loading…
Reference in New Issue
Block a user