From: Michael Adam Date: Sun, 13 Apr 2008 12:40:51 +0000 (+0200) Subject: registry cachehook: revert logic to make fast path more obvious and reduce indent. X-Git-Tag: samba-3.3.0pre1~2706 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e97d558c5660e6d235b62528f5527a62ac1252d7;p=thirdparty%2Fsamba.git registry cachehook: revert logic to make fast path more obvious and reduce indent. Michael --- diff --git a/source/registry/reg_cachehook.c b/source/registry/reg_cachehook.c index c7f099e134c..db07330820d 100644 --- a/source/registry/reg_cachehook.c +++ b/source/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(®db_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 *)®db_ops, - KEY_TREE_ROOT)); + if (cache_tree != NULL) { + return WERR_OK; } + cache_tree = pathtree_init(®db_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 *)®db_ops, + KEY_TREE_ROOT)); return WERR_OK; }