]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Simplify smbXcli_req_unset_pending()
authorVolker Lendecke <vl@samba.org>
Mon, 10 Feb 2025 10:08:06 +0000 (11:08 +0100)
committerRalph Boehme <slow@samba.org>
Wed, 5 Mar 2025 17:41:33 +0000 (17:41 +0000)
We have ARRAY_DEL_ELEMENT() for this

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
libcli/smb/smbXcli_base.c

index 7f275b5999189546bcfbaa9bfeee02f05e3ca0e7..1e8ccb785def32ac02b460c589304f7b9a340637 100644 (file)
@@ -1063,12 +1063,7 @@ void smbXcli_req_unset_pending(struct tevent_req *req)
                return;
        }
 
-       /*
-        * Remove ourselves from the conn->pending array
-        */
-       for (; i < (num_pending - 1); i++) {
-               conn->pending[i] = conn->pending[i+1];
-       }
+       ARRAY_DEL_ELEMENT(conn->pending, i, num_pending);
 
        /*
         * No NULL check here, we're shrinking by sizeof(void *), and