- /* make sure the dict of next level exists */
- if (errcode == mismatch_error) {
- nextlevel=xbt_dict_new();
- VERB1("Create a dict (%p)",nextlevel);
- xbt_dict_set_ext(thislevel, thiskey, thislen, nextlevel, &_free_dict);
+ /* search the dict of next level */
+ nextlevel = xbt_dict_get_or_null_ext(thislevel, thiskey, thislen);
+ if (nextlevel == NULL) {
+ /* make sure the dict of next level exists */
+ nextlevel = xbt_dict_new();
+ VERB1("Create a dict (%p)", nextlevel);
+ xbt_dict_set_ext(thislevel, thiskey, thislen, nextlevel,
+ &_free_dict);