- if (host->properties() != nullptr) {
- char* off_power_str = (char*)xbt_dict_get_or_null(host->properties(), "watt_off");
- if (off_power_str != nullptr) {
- char* msg = bprintf("Invalid value for property watt_off of host %s: %%s", host->cname());
- watts_off = xbt_str_parse_double(off_power_str, msg);
- xbt_free(msg);
- }
- else
- watts_off = 0;
+ const char* off_power_str = host->property("watt_off");
+ if (off_power_str != nullptr) {
+ char* msg = bprintf("Invalid value for property watt_off of host %s: %%s", host->cname());
+ this->watts_off = xbt_str_parse_double(off_power_str, msg);
+ xbt_free(msg);