summaryrefslogtreecommitdiff
path: root/src/attrcache.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2015-10-27 17:26:04 +0100
committerVicent Marti <tanoku@gmail.com>2015-10-28 10:13:13 +0100
commit1e5e02b4f47779fe3733b1a6ab24a6ca13099ec3 (patch)
treeac854971d3609c9065cbaee0119541428bdc9477 /src/attrcache.c
parentefc659b071e02c6d3b39b32b35ab83233d978956 (diff)
downloadlibgit2-1e5e02b4f47779fe3733b1a6ab24a6ca13099ec3.tar.gz
pool: Simplify implementation
Diffstat (limited to 'src/attrcache.c')
-rw-r--r--src/attrcache.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/attrcache.c b/src/attrcache.c
index 5bc260460..a57110684 100644
--- a/src/attrcache.c
+++ b/src/attrcache.c
@@ -388,10 +388,11 @@ int git_attr_cache__do_init(git_repository *repo)
* hashtable for attribute macros, and string pool
*/
if ((ret = git_strmap_alloc(&cache->files)) < 0 ||
- (ret = git_strmap_alloc(&cache->macros)) < 0 ||
- (ret = git_pool_init(&cache->pool, 1, 0)) < 0)
+ (ret = git_strmap_alloc(&cache->macros)) < 0)
goto cancel;
+ git_pool_init(&cache->pool, 1);
+
cache = git__compare_and_swap(&repo->attrcache, NULL, cache);
if (cache)
goto cancel; /* raced with another thread, free this but no error */