]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ldb: Use ARRAY_DEL_ELEMENT() in ldb_kv_index_del_value()
authorVolker Lendecke <vl@samba.org>
Thu, 26 Mar 2020 10:08:07 +0000 (11:08 +0100)
committerRalph Boehme <slow@samba.org>
Thu, 26 Mar 2020 14:43:32 +0000 (14:43 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
lib/ldb/ldb_key_value/ldb_kv_index.c

index 5a24b074e1c02078064c3decb1095e99450ff84e..9be7c5adcbee52c92410aa50f2e94609ebfd4e60 100644 (file)
@@ -3266,9 +3266,7 @@ int ldb_kv_index_del_value(struct ldb_module *module,
        }
 
        j = (unsigned int) i;
-       if (j != list->count - 1) {
-               memmove(&list->dn[j], &list->dn[j+1], sizeof(list->dn[0])*(list->count - (j+1)));
-       }
+       ARRAY_DEL_ELEMENT(list->dn, j, list->count);
        list->count--;
        if (list->count == 0) {
                talloc_free(list->dn);