Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
remove_at already frees the element if last argument equals to NULL, so do not duppli...
authormquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 10 May 2007 14:55:15 +0000 (14:55 +0000)
committermquinson <mquinson@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 10 May 2007 14:55:15 +0000 (14:55 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@3502 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/xbt/dynar.c

index 8fc3b1b..7a567b9 100644 (file)
@@ -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