I have this very simple method:
private boolean isTheParticipantTalking(ParticipantID participantId){
if(mCurrentParticipant != null) {
return participantId.equals(mCurrentParticipant.getId());
}
return false; // no one is talking
}
I receive a warning stating that I can simplify the code in the following manner:
private boolean isTheParticipantTalking(ParticipantID participantId){
return mCurrentParticipant != null && participantId.equals(mCurrentParticipant.getId());
}
In your opinion, is this change desirable? I understand that we go from 4 lines of code to just 1, but I find my way more understandable in one blick.
if
statements. I probably would. \$\endgroup\$