X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/96cedde3cdbc0b8ffc3f096a1b65d021b0226f99..6cf83e2b8b91315daaf30dc22f610af68c6d672c:/include/xbt/dynar.h diff --git a/include/xbt/dynar.h b/include/xbt/dynar.h index 5384cfbfec..c22b219bcd 100644 --- a/include/xbt/dynar.h +++ b/include/xbt/dynar.h @@ -210,11 +210,8 @@ static inline int _xbt_dynar_cursor_get(const xbt_dynar_t dynar, unsigned int id if (!dynar) /* iterating over a NULL dynar is a no-op */ return 0; - if (idx >= dynar->used) { - //XBT_DEBUG("Cursor on %p already on last elem", (void *) dynar); + if (idx >= dynar->used) return 0; - } - // XBT_DEBUG("Cash out cursor on %p at %u", (void *) dynar, *idx); memcpy(dst, ((char *) dynar->data) + idx * dynar->elmsize, dynar->elmsize); @@ -260,16 +257,4 @@ xbt_dynar_foreach (dyn,cpt,str) { /** @} */ SG_END_DECL() -#ifdef __cplusplus -namespace simgrid { -namespace xbt { -/** Dynar of `T*` which `delete` its values */ -template inline xbt_dynar_t newDeleteDynar() -{ - return xbt_dynar_new(sizeof(T*), [](void* p) { delete *(T**)p; }); -} -} -} -#endif - #endif /* XBT_DYNAR_H */