Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
take care of new dll import and dll export in Windows
[simgrid.git] / src / xbt / dynar.c
index 2c1e7dc..8fc3b1b 100644 (file)
@@ -381,6 +381,10 @@ xbt_dynar_insert_at(xbt_dynar_t  const dynar,
  *
  * Get the Nth element of a dynar, removing it from the dynar and moving
  * all subsequent values to one position left in the dynar.
+ * 
+ * If the object argument of this function is a non-null pointer, the removed 
+ * element is copied to this address. If not, the element is freed using the 
+ * free_f function passed at dynar creation.
  */
 void
 xbt_dynar_remove_at(xbt_dynar_t  const dynar,
@@ -428,7 +432,7 @@ xbt_dynar_search(xbt_dynar_t  const dynar,
                 void        *const elem) {
   int it;
    
-  for (it=0; it< dynar->size; it++) 
+  for (it=0; it< dynar->used; it++) 
     if (!memcmp(_xbt_dynar_elm(dynar, it),elem,dynar->elmsize))
       return it;