File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -174,17 +174,17 @@ namespace Core::Binstrategy::Utils
174174 // ---- pack data for sending -----
175175 std::map<int , std::vector<char >> sdata;
176176 std::vector<int > targetprocs (numproc, 0 );
177- std::map< int , std::vector<std::pair< int , std::vector< int >>>>::const_iterator p;
178- for (p = toranktosendbinids. begin (); p != toranktosendbinids. end (); ++p )
177+
178+ for (const auto & [rank, bin_list] : toranktosendbinids)
179179 {
180- std::vector<std::pair< int , std::vector< int >>>::const_iterator iter ;
181- for (iter = p-> second . begin (); iter != p-> second . end (); ++iter )
180+ Core::Communication::PackBuffer data ;
181+ for (const auto & bin : bin_list )
182182 {
183- Core::Communication::PackBuffer data;
184- add_to_pack (data, *iter);
185- sdata[p->first ].insert (sdata[p->first ].end (), data ().begin (), data ().end ());
183+ add_to_pack (data, bin);
186184 }
187- targetprocs[p->first ] = 1 ;
185+ auto & buffer = sdata[rank];
186+ buffer.insert (buffer.end (), data ().begin (), data ().end ());
187+ targetprocs[rank] = 1 ;
188188 }
189189
190190 // ---- send ----
You can’t perform that action at this time.
0 commit comments