Rewrite if/else chain as if/return blocks

Just a matter of preference :-)

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez 2022-11-13 18:14:10 +01:00
parent dceb4a6d79
commit 3762526318

View file

@ -372,14 +372,32 @@ public class PeerConnectionWrapper {
if (nick != null) {
dataChannelMessageNotifier.notifyNickChanged(nick);
}
} else if ("audioOn".equals(dataChannelMessage.getType())) {
return;
}
if ("audioOn".equals(dataChannelMessage.getType())) {
dataChannelMessageNotifier.notifyAudioOn();
} else if ("audioOff".equals(dataChannelMessage.getType())) {
return;
}
if ("audioOff".equals(dataChannelMessage.getType())) {
dataChannelMessageNotifier.notifyAudioOff();
} else if ("videoOn".equals(dataChannelMessage.getType())) {
return;
}
if ("videoOn".equals(dataChannelMessage.getType())) {
dataChannelMessageNotifier.notifyVideoOn();
} else if ("videoOff".equals(dataChannelMessage.getType())) {
return;
}
if ("videoOff".equals(dataChannelMessage.getType())) {
dataChannelMessageNotifier.notifyVideoOff();
return;
}
}
}