- for (i = 0; i < var->cnsts_number; i++) {
- if (var->cnsts[i].value == 0.0)
- nb++;
- }
- if ((nb == var->cnsts_number) && (var->weight > 0.0)) {
- XBT_DEBUG("Err, finally, there is no need to take care of variable %p",
- var);
+ auto weighted = std::find_if(begin(var->cnsts), end(var->cnsts),
+ [](s_lmm_element_t const& x) { return x.consumption_weight != 0.0; });
+ if (weighted == end(var->cnsts) && var->sharing_weight > 0.0) {
+ XBT_DEBUG("Err, finally, there is no need to take care of variable %p", var);