1
0
mirror of https://github.com/TeamNewPipe/NewPipe.git synced 2024-11-22 11:02:35 +01:00

Refactor ChannelTab.equals

This commit is contained in:
Eric Xu 2021-05-22 00:22:44 -04:00 committed by Zhiheng Xu
parent d2b03afcf4
commit 14bbaccb9f

View File

@ -446,9 +446,14 @@ public abstract class Tab {
@Override
public boolean equals(final Object obj) {
return super.equals(obj) && channelServiceId == ((ChannelTab) obj).channelServiceId
&& Objects.equals(channelUrl, ((ChannelTab) obj).channelUrl)
&& Objects.equals(channelName, ((ChannelTab) obj).channelName);
if (!(obj instanceof ChannelTab)) {
return false;
}
final ChannelTab other = (ChannelTab) obj;
return super.equals(obj)
&& channelServiceId == other.channelServiceId
&& channelUrl.equals(other.channelName)
&& channelName.equals(other.channelName);
}
public int getChannelServiceId() {