Enlightenment CVS committal Author : rbdpngn Project : e17 Module : libs/etox
Dir : e17/libs/etox/src Modified Files: etox_line.c Log Message: Improve that freeing loop. Free the list parts on traversal, rather than causing the list to be traversed a second time on the evas_list_free call. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/etox/src/etox_line.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- etox_line.c 24 Jul 2003 01:41:44 -0000 1.11 +++ etox_line.c 24 Jul 2003 01:46:42 -0000 1.12 @@ -31,27 +31,16 @@ void etox_line_free(Etox_Line * line) { Estyle *bit; - Evas_List *l; CHECK_PARAM_POINTER("line", line); /* - * Only traverse the list if there are bits present. + * Free all of the bits on the line. */ - if (line->bits) { - - /* - * Free all of the bits on the line. - */ - for (l = line->bits; l; l = l->next) { - bit = l->data; - estyle_free(bit); - } - - /* - * Clean up the remaining list - */ - evas_list_free(line->bits); + while (line->bits) { + bit = line->bits->data; + estyle_free(bit); + line->bits = evas_list_remove(line->bits, bit); } FREE(line); ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs