From: Ralph Boehme Date: Fri, 16 Feb 2024 15:19:34 +0000 (+0100) Subject: winbindd: collapse two if expressions X-Git-Tag: tdb-1.4.11~55 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cbd4aee50b51b5de129bcfc15a3f2c348a9140c8;p=thirdparty%2Fsamba.git winbindd: collapse two if expressions No change in behaviour. After calling set_domain_offline() domain->offline will be set to false, iow everytime if (!domain->internal && was_online) is true, if (!domain->internal && !domain->online && was_online) will also true, so we can drop the second if expression. Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source3/winbindd/winbindd_cache.c b/source3/winbindd/winbindd_cache.c index d5b8ef50822..22817388e87 100644 --- a/source3/winbindd/winbindd_cache.c +++ b/source3/winbindd/winbindd_cache.c @@ -1842,14 +1842,13 @@ NTSTATUS wb_cache_name_to_sid(struct winbindd_domain *domain, NT_STATUS_EQUAL(status, NT_STATUS_DOMAIN_CONTROLLER_NOT_FOUND)) { if (!domain->internal && was_online) { + /* Set the domain offline and query the cache again */ set_domain_offline(domain); - } - if (!domain->internal && - !domain->online && - was_online) { - NTSTATUS cache_status; - cache_status = wcache_name_to_sid(domain, domain_name, name, sid, type); - return cache_status; + return wcache_name_to_sid(domain, + domain_name, + name, + sid, + type); } } /* and save it */