]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
loadparm: Simplify lp_get_async_dns_timeout()
authorVolker Lendecke <vl@samba.org>
Sun, 29 Nov 2020 12:05:02 +0000 (13:05 +0100)
committerJeremy Allison <jra@samba.org>
Mon, 30 Nov 2020 22:24:37 +0000 (22:24 +0000)
Use MAX, and per README.Coding we don't need the intermediate
variable. This can be inspected in the debugger directly.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/param/loadparm.c

index c218e2fc372444f16168c386e123081fc38ff169..fbeed6782ad82edb2260f539e422c69e3b65f8ae 100644 (file)
@@ -4763,13 +4763,9 @@ enum samba_weak_crypto lp_weak_crypto()
 
 uint32_t lp_get_async_dns_timeout(void)
 {
-       uint32_t val = Globals.async_dns_timeout;
        /*
         * Clamp minimum async dns timeout to 1 second
         * as per the man page.
         */
-       if (val < 1) {
-               val = 1;
-       }
-       return val;
+       return MAX(Globals.async_dns_timeout, 1);
 }