From: mquinson Date: Thu, 10 May 2007 14:55:15 +0000 (+0000) Subject: remove_at already frees the element if last argument equals to NULL, so do not duppli... X-Git-Tag: v3.3~1858 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b2991a6a2a69c2c74cffc6e54c1888ad70824c81?ds=sidebyside remove_at already frees the element if last argument equals to NULL, so do not dupplicate the code here git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3502 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/xbt/dynar.c b/src/xbt/dynar.c index 8fc3b1b1c7..7a567b9d28 100644 --- a/src/xbt/dynar.c +++ b/src/xbt/dynar.c @@ -597,25 +597,8 @@ xbt_dynar_cursor_get(const xbt_dynar_t dynar, */ void xbt_dynar_cursor_rm(xbt_dynar_t dynar, int * const cursor) { - void *dst; - - if (dynar->elmsize > sizeof(void*)) { - DEBUG0("Elements too big to fit into a pointer"); - if (dynar->free_f) { - dst=xbt_malloc(dynar->elmsize); - xbt_dynar_remove_at(dynar,(*cursor)--,dst); - (dynar->free_f)(dst); - free(dst); - } else { - DEBUG0("Ok, we dont care about the element without free function"); - xbt_dynar_remove_at(dynar,(*cursor)--,NULL); - } - - } else { - xbt_dynar_remove_at(dynar,(*cursor)--,&dst); - if (dynar->free_f) - (dynar->free_f)(dst); - } + + xbt_dynar_remove_at(dynar,(*cursor)--,NULL); } #ifdef SIMGRID_TEST