mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-21 13:53:37 -07:00
Prevent self-assignment in assignment operator
This commit is contained in:
parent
c598bdd290
commit
298d63d47c
2 changed files with 8 additions and 2 deletions
|
@ -88,8 +88,11 @@ TorrentInfo::TorrentInfo(const TorrentInfo &other)
|
||||||
}
|
}
|
||||||
|
|
||||||
TorrentInfo &TorrentInfo::operator=(const TorrentInfo &other)
|
TorrentInfo &TorrentInfo::operator=(const TorrentInfo &other)
|
||||||
|
{
|
||||||
|
if (this != &other)
|
||||||
{
|
{
|
||||||
m_nativeInfo = other.m_nativeInfo;
|
m_nativeInfo = other.m_nativeInfo;
|
||||||
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -441,8 +441,11 @@ bool AutoDownloadRule::accepts(const QVariantHash &articleData)
|
||||||
}
|
}
|
||||||
|
|
||||||
AutoDownloadRule &AutoDownloadRule::operator=(const AutoDownloadRule &other)
|
AutoDownloadRule &AutoDownloadRule::operator=(const AutoDownloadRule &other)
|
||||||
|
{
|
||||||
|
if (this != &other)
|
||||||
{
|
{
|
||||||
m_dataPtr = other.m_dataPtr;
|
m_dataPtr = other.m_dataPtr;
|
||||||
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue