X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/13cd9720a322a749793d9103a09acc8f2b622149..9992c04bba629eccd44905b4db102436727a779d:/src/xbt/dict.cpp diff --git a/src/xbt/dict.cpp b/src/xbt/dict.cpp index 280d047537..6573bb88ed 100644 --- a/src/xbt/dict.cpp +++ b/src/xbt/dict.cpp @@ -15,6 +15,7 @@ #include "xbt/string.hpp" #include "xbt/xbt_modinter.h" +#include #include #include @@ -90,7 +91,7 @@ static void xbt_dict_rehash(xbt_dict_t dict) unsigned newsize = oldsize * 2; auto* newtable = static_cast(xbt_realloc(dict->table, newsize * sizeof(xbt_dictelm_t))); - memset(&newtable[oldsize], 0, oldsize * sizeof(xbt_dictelm_t)); /* zero second half */ + std::fill(newtable + oldsize, newtable + newsize, nullptr); /* zero second half */ newsize--; dict->table_size = newsize; dict->table = newtable;