On Tue, Jul 3, 2012 at 1:17 PM, Raphael Kubo da Costa <[email protected]> wrote: > Cedric BAIL <[email protected]> writes: >>>>> - *_foreach(): >>>>> One could argue that passing NULL should be equivalent to an empty >>>>> loop. For example, right now >>>>> eina_iterator_foreach(NULL, ..., ...) >>>>> generates a magic check error message, while >>>>> EINA_ITERATOR_FOREACH(NULL, ...) >>>>> does not. >> >> There is valid use case for when an iterator could be NULL. If you do : >> it = eina_file_stat_ls("/plop"); >> EINA_ITERATOR_FOREACH(it, ...) >> { >> .... >> } >> eina_iterator_free(it); >> >> It cleary simplify the code in my opinion without impacting speed at >> all if we do handle it == NULL case. So for this one I would like to >> have it handle. > > That's exactly what caused me to look into this :-) I've changed > eina_iterator_foreach() so that it just returns early without > complaining if a NULL iterator is passed to it, so both > eina_iterator_free() and EINA_ITERATOR_FREE() should have a more similar > behavior now.
In svn (with little modification in header to, to take this change into account). -- Cedric BAIL ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
