27 Nov
2014
27 Nov
'14
5:24 a.m.
On 27.11.2014 8:11, Alistair Leslie-Hughes wrote:
+ if(dwComponentID > list_count(&This->components)) + return DPNERR_DOESNOTEXIST; + + LIST_FOR_EACH_ENTRY(entry, &This->components, struct component, entry) + { + if(count == dwComponentID)
This means you really want to use array instead of a list. This will speed up GetNumComponents() and GetComponentByIndex(), while GetComponentByName() will still need to iterate.