mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-10-22 10:46:04 +03: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
|
@ -89,7 +89,10 @@ 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -442,7 +442,10 @@ 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…
Reference in a new issue