Replaced ternary operators with if statements (#346)

Instances of the ternary operator were replaced with if statements to make the code base more consistent.
This commit is contained in:
Tyler Veness
2017-11-08 23:44:03 -08:00
committed by Peter Johnson
parent c8e44256ef
commit 7efab4c43a
7 changed files with 58 additions and 39 deletions

View File

@@ -154,6 +154,7 @@ DoubleSolenoid::Value DoubleSolenoid::Get() const {
if (valueReverse) return kReverse;
return kOff;
}
/**
* Check if the forward solenoid is blacklisted.
*
@@ -165,8 +166,9 @@ DoubleSolenoid::Value DoubleSolenoid::Get() const {
*/
bool DoubleSolenoid::IsFwdSolenoidBlackListed() const {
int blackList = GetPCMSolenoidBlackList(m_moduleNumber);
return (blackList & m_forwardMask) ? 1 : 0;
return (blackList & m_forwardMask) != 0;
}
/**
* Check if the reverse solenoid is blacklisted.
*
@@ -178,7 +180,7 @@ bool DoubleSolenoid::IsFwdSolenoidBlackListed() const {
*/
bool DoubleSolenoid::IsRevSolenoidBlackListed() const {
int blackList = GetPCMSolenoidBlackList(m_moduleNumber);
return (blackList & m_reverseMask) ? 1 : 0;
return (blackList & m_reverseMask) != 0;
}
void DoubleSolenoid::UpdateTable() {