Re: [gtk-list] Re: g_[s]list_qsort suggestion



> though just changing the ->data portion of all the GList structures is
> an efficient solution, this is not always what's needed. we loose the
> ability to hold GList pointers across g_list_qsort() invokations with this.
> 
> GList *sort_me;
> 
> [...]
> 
> GList *first_item;
> 
> first_item = sort_me;
> 
> sort_me = g_list_qsort (sort_me, SomeSortFunc);
> 
> [now, `first_item' still points to the first GList structure, but not to the same
>  ->data anymore.]

how about making two functions g_list_qsort and g_list_qsort_fast, where the fast
version would not shuffle the pointers around, but just the ->data

George

-- 
------------------------------------------------------------------------------
George Lebl <jirka@5z.com> http://www.5z.com/jirka/
------------------------------------------------------------------------------
  The following implements RSA in perl and is illegal to export from the US:

          #!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj
          $/=unpack('H*',$_);$_=`echo 16dio\U$k"SK$/SM$n\EsN0p[lN*1
          lK[d2%Sa2/d0$^Ixp"|dc`;s/\W//g;$_=pack('H*',/((..)*)$/)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]