[pacman-dev] alpm_list_remove_dups: was - [PATCH] Sort and avoid duplicates in -Sii output

Xavier Chantry chantry.xavier at gmail.com
Wed Mar 24 20:20:46 CET 2010

On Wed, Mar 24, 2010 at 7:43 PM, Nagy Gabor <ngaba at bibl.u-szeged.hu> wrote:
>> I was going to use alpm_list_remove_dups instead of testing for a
>> strings presence before adding it but I find that function quite
>> impractical...
>> I wonder if any other frontend is using it and whether we could change
>> it to actually removing the duplicates from a list.  i.e. return the
>> same list with duplicates removed and their data freed.  Or am I
>> missing some usage case where the current functionality is useful?
>> Allan
> Just a sidenote: remove_dup could be done in O(n) time, when the list is
> sorted. :-)

Or we could kill remove_dup and make a variant of msort that does not
keep duplicate. hmmm

More information about the pacman-dev mailing list