Have some variables that I need to perform validation on. Pseudocode is as follows but I feel there must be a more elegant soloution.
If ( var != A || var != B || var != C || var != D )
{
reject
}
else if ( var == A || var == B)
{
do validation applicable to A or B
}
else if ( var == A || var == B || var == C || var == D )
{
do validation applicable to all valid vars
}
The original pseudocode is incorrect, so I have made some reasonable assumptions about the required behaviour.
Or you could flip the logic as follows:
which may be clearer.