[PATCH v3 7/7] clear_cached_refs(): inline function
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Oct 12, 2011, 18:44 UTC
- Message-ID
- <1318445067-19279-8-git-send-email-mhagger@alum.mit.edu>
- In-Reply-To
- <1318445067-19279-1-git-send-email-mhagger@alum.mit.edu>
clear_cached_refs() was only called from one place, so inline it there.
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu> --- refs.c | 10 +++------- 1 files changed, 3 insertions(+), 7 deletions(-)
diff --git a/refs.c b/refs.c index 9e9edf7..409314d 100644 --- a/refs.c +++ b/refs.c @@ -172,12 +172,6 @@ static void clear_cached_loose_refs(struct cached_refs *refs) refs->did_loose = 0; } -static void clear_cached_refs(struct cached_refs *refs) -{ - clear_cached_packed_refs(refs); - clear_cached_loose_refs(refs); -} - static struct cached_refs *create_cached_refs(const char *submodule) { int len; @@ -215,7 +209,9 @@ static struct cached_refs *get_cached_refs(const char *submodule) void invalidate_ref_cache(const char *submodule) { - clear_cached_refs(get_cached_refs(submodule)); + struct cached_refs *refs = get_cached_refs(submodule); + clear_cached_packed_refs(refs); + clear_cached_loose_refs(refs); } static void read_packed_refs(FILE *f, struct ref_array *array)
-- 1.7.7.rc2