clarify ^ vs ?:

cppcheck (via Codacy) points out the operator precidence is unclearn. Added parentheses to fix that.
This commit is contained in:
Gregory A Lundberg 2018-01-25 21:11:07 -06:00
parent 45eae14999
commit 8f22144e8e
No known key found for this signature in database
GPG Key ID: 149484078AE8AE9E

View File

@ -148,7 +148,7 @@ void statistics_dialog::add_damage_row(
str << damage << " / "
<< static_cast<double>(shifted) * 0.1
<< " " // TODO: should probably make this two columns
<< ((dsa < 0) ^ (expected < 0) ? "" : "+")
<< (((dsa < 0) ^ (expected < 0)) ? "" : "+")
<< (expected == 0 ? 0 : 100 * dsa / expected) << '%';
item["label"] = str.str();
@ -161,7 +161,7 @@ void statistics_dialog::add_damage_row(
str << turn_damage << " / "
<< static_cast<double>(turn_shifted) * 0.1
<< " " // TODO: should probably make this two columns
<< ((dst < 0) ^ (turn_expected < 0) ? "" : "+")
<< (((dst < 0) ^ (turn_expected < 0)) ? "" : "+")
<< (turn_expected == 0 ? 0 : 100 * dst / turn_expected) << '%';
item["label"] = str.str();