- std::for_each(neigh.begin(), neigh.end(),
- bind(&process::insert_neighbor_in_map, this, _1));
-
- pneigh.resize(neigh.size());
- std::transform(neigh.begin(), neigh.end(), pneigh.begin(),
- misc::address<neighbor>());
+ pneigh.reserve(neigh.size());
+ for (unsigned i = 0 ; i < neigh.size() ; i++) {
+ neighbor* ptr = &neigh[i];
+ m_host_t host = MSG_get_host_by_name(ptr->get_name());
+ pneigh.push_back(ptr);
+ rev_neigh.insert(std::make_pair(host, ptr));
+ }