From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107045 invoked by alias); 7 Feb 2018 14:48:40 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 106969 invoked by uid 89); 7 Feb 2018 14:48:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: smtp.ispras.ru Date: Wed, 07 Feb 2018 15:07:00 -0000 From: Alexander Monakov To: Adhemerval Zanella cc: libc-alpha@sourceware.org Subject: Re: [PATCH 2/3] dynarray: Implement remove function In-Reply-To: <1518008967-8310-2-git-send-email-adhemerval.zanella@linaro.org> Message-ID: References: <1518008967-8310-1-git-send-email-adhemerval.zanella@linaro.org> <1518008967-8310-2-git-send-email-adhemerval.zanella@linaro.org> User-Agent: Alpine 2.20.13 (LNX 116 2015-12-14) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SW-Source: 2018-02/txt/msg00250.txt.bz2 On Wed, 7 Feb 2018, Adhemerval Zanella wrote: > This patch implements the remove item function for dynarray array. > It is a costly operation, since it requires a memory move operation > possible as large as the array size less one element. If preserving order is not required, then removing an element is as cheap as moving only the last element to the position of the removed. If order preservation, is, in fact, part of the intended interface, then shouldn't the new function be named like '..._ordered_remove' to reflect that? Alexander