On 12/13/2010 05:34 AM, Alexandre Julliard wrote:
Andrew Eikum<aeikum(a)codeweavers.com> writes:
- /* search element n in list */ - for(i=0; i< index; i++) + i = 0; + LIST_FOR_EACH_ENTRY (pTypeInfo,&This->typeinfo_list, ITypeInfoImpl, entry) + { + if(i>= index) + break; + ++i; + }
It looks like an array would be more appropriate than a list.
An array would work, especially for the static structures that are used now, but these cleanup patches were made with the goal of merging the typelib-reading and typelib-creation interfaces in mind. Specifically, implementing the typelib-creation interfaces using the current data structures in typelib.c. Given the function ICreateTypeLib::CreateTypeInfo(), a list seems more appropriate to me.