smbd: Slightly simplify smbd_smb2_query_directory_send()
authorVolker Lendecke <vl@samba.org>
Mon, 27 Nov 2023 09:51:45 +0000 (10:51 +0100)
committerGünther Deschner <gd@samba.org>
Tue, 19 Dec 2023 16:05:36 +0000 (16:05 +0000)
Avoid an if-statement when just assigning the result of the
if-condition to a boolean.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/smbd/smb2_query_directory.c

index 5f1a52c194c3210d64ab31524273bedc488d3e75..ebbbbb39911037402f05f511740763a0e45982ee 100644 (file)
@@ -471,10 +471,11 @@ static struct tevent_req *smbd_smb2_query_directory_send(TALLOC_CTX *mem_ctx,
                "in_output_buffer_length = %u\n",
                 fsp->fsp_name->base_name, lp_dont_descend(talloc_tos(), lp_sub, SNUM(conn)),
                (unsigned int)in_output_buffer_length ));
-       if (in_list(fsp->fsp_name->base_name,lp_dont_descend(talloc_tos(), lp_sub, SNUM(conn)),
-                       posix_dir_handle ? true : conn->case_sensitive)) {
-               state->dont_descend = true;
-       }
+
+       state->dont_descend = in_list(
+               fsp->fsp_name->base_name,
+               lp_dont_descend(talloc_tos(), lp_sub, SNUM(conn)),
+               posix_dir_handle ? true : conn->case_sensitive);
 
        /*
         * SMB_FIND_FILE_NAMES_INFO doesn't need stat information