[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Why ldap_<first,next>_attribute ?



Mark Smith wrote:

> I don't think there is any special reason why the
> ldap_first/next_attribute() approach was used instead of just returning
> an array.

How big did you make the array? Guess what, I want one more! BOOOOM! In
general, a linked list is a better solution when the dimension of the
array would be hard to quess and be safe. The only real downside is that
you need to be careful to free the memory when you are done, and of
course it runs a little more slowly than an array. Both problems may in
fact be addressed behind the scenes so that so memory is preallocated
and reused, who knows.
first gives you the head of the list and next walks.
-- 

Ian Bruce
(630) 713-7387
ianbruce@lucent.com