Re: glib: changes to the g*_array API.



> I would like the name `g_sorted_array_remove_index' (or
> g_ordered_array_remove_index) for the new function.  This will give a
> very strong indication of the time complexity O(n), and makes sure
> people won't use it casually, unless they want the ordering semantics.

No, I wouldn't:
1. the operation should follow glib's naming conventions. (i.e. at least 
   something like g_array....)
2. the natural way to remove an element from an vector (or array for that
   matter) is to move all following elements down one position, so the
rule
   of least suprise actually calls for this semantic. 

Bye
Sebastian
-- 
+--------------============####################============--------------+
| Sebastian Wilhelmi, Institute for Computer Design and Fault Tolerance, |
| University of Karlsruhe;  Building 20.20, Room 263,  D-76128 Karlsruhe |
| mail: wilhelmi@ira.uka.de;  fax: +49 721 370455;  fon: +49 721 6084353 |
+-----------------> http://goethe.ira.uka.de/~wilhelmi <-----------------+



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