- route_cache_element_t elm = nullptr;
- if (routeCache_) { /* cache mode */
- elm = (route_cache_element_t)xbt_dict_get_or_null_ext(routeCache_, (char*)(&src_id), sizeof(int));
- }
-
- if (elm) { /* cached mode and cache hit */
- pred_arr = elm->pred_arr;
- } else { /* not cached mode, or cache miss */
+ auto elm = routeCache_.emplace(src_id, std::vector<int>());
+ std::vector<int>& pred_arr = elm.first->second;