Reputation: 476
This is my line of code.
Can I replace this with much more graceful syntax?
if ( colDiffuseCompare == colDiffuseReplace && colAmbientCompare == colAmbientReplace && colEmissionCompare == colEmissionReplace && colSpecularCompare == colSpecularReplace)
{
return true;
}
else
{
return false;
}
Upvotes: 2
Views: 46
Reputation: 1
You don't need the if()
for such case:
return colDiffuseCompare == colDiffuseReplace &&
colAmbientCompare == colAmbientReplace &&
colEmissionCompare == colEmissionReplace &&
colSpecularCompare == colSpecularReplace;
There's no way to avoid combining the single conditions though.
Upvotes: 3