X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ab8bc0a329a7dce9b91f3dd24ac869052e4402eb..573c7a5e13ac11e8e0444378bb8f88e5b200e0bc:/src/xbt/dynar.c diff --git a/src/xbt/dynar.c b/src/xbt/dynar.c index b503343be7..8fc3b1b1c7 100644 --- a/src/xbt/dynar.c +++ b/src/xbt/dynar.c @@ -380,8 +380,11 @@ xbt_dynar_insert_at(xbt_dynar_t const dynar, /** @brief Remove the Nth dynar's element, sliding the previous values to the left * * Get the Nth element of a dynar, removing it from the dynar and moving - * all subsequent values to one position left in the dynar. Note that the free - * function is called only if object == NULL. + * 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, @@ -429,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;