summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-13 14:40:51 +0200
committerMichael Adam <obnox@samba.org>2008-04-13 15:33:47 +0200
commit84c5da2ff490c68fcdd66c2ca909c54faed23e8c (patch)
tree570d5945f65cbff8e547871cd293bb1a7f1ba0a7 /source3
parent4b4306eb4a55ae1c705464e3220d963651ce9b91 (diff)
downloadsamba-84c5da2ff490c68fcdd66c2ca909c54faed23e8c.tar.gz
samba-84c5da2ff490c68fcdd66c2ca909c54faed23e8c.tar.bz2
samba-84c5da2ff490c68fcdd66c2ca909c54faed23e8c.zip
registry cachehook: revert logic to make fast path more obvious and reduce indent.
Michael (This used to be commit e97d558c5660e6d235b62528f5527a62ac1252d7)
Diffstat (limited to 'source3')
-rw-r--r--source3/registry/reg_cachehook.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source3/registry/reg_cachehook.c b/source3/registry/reg_cachehook.c
index c7f099e134..db07330820 100644
--- a/source3/registry/reg_cachehook.c
+++ b/source3/registry/reg_cachehook.c
@@ -56,16 +56,17 @@ static char *keyname_to_path(TALLOC_CTX *mem_ctx, const char *keyname)
WERROR reghook_cache_init(void)
{
- if (cache_tree == NULL) {
- cache_tree = pathtree_init(&regdb_ops, NULL);
- if (cache_tree == NULL) {
- return WERR_NOMEM;
- }
- DEBUG(10, ("reghook_cache_init: new tree with default "
- "ops %p for key [%s]\n", (void *)&regdb_ops,
- KEY_TREE_ROOT));
+ if (cache_tree != NULL) {
+ return WERR_OK;
}
+ cache_tree = pathtree_init(&regdb_ops, NULL);
+ if (cache_tree == NULL) {
+ return WERR_NOMEM;
+ }
+ DEBUG(10, ("reghook_cache_init: new tree with default "
+ "ops %p for key [%s]\n", (void *)&regdb_ops,
+ KEY_TREE_ROOT));
return WERR_OK;
}