- double myLoad = get_load();
- for (unsigned i = 0; i < pneigh.size(); i++) {
- double delta = std::max(myLoad - pneigh[i]->get_load(), 0.0);
+ double my_load = get_load();
+ bool cont = true;
+ for (unsigned i = 0 ;
+ cont && i < pneigh.size() && pneigh[i]->get_load() < my_load ; ++i) {
+
+ double delta = my_load - pneigh[i]->get_load();