mirror of
https://github.com/d47081/qBittorrent.git
synced 2025-03-10 20:31:47 +00:00
Prevent self-assignment in assignment operator
This commit is contained in:
parent
8f02fe0cc6
commit
2efd4f2a77
@ -88,7 +88,10 @@ TorrentInfo::TorrentInfo(const TorrentInfo &other)
|
|||||||
|
|
||||||
TorrentInfo &TorrentInfo::operator=(const TorrentInfo &other)
|
TorrentInfo &TorrentInfo::operator=(const TorrentInfo &other)
|
||||||
{
|
{
|
||||||
m_nativeInfo = other.m_nativeInfo;
|
if (this != &other)
|
||||||
|
{
|
||||||
|
m_nativeInfo = other.m_nativeInfo;
|
||||||
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -440,7 +440,10 @@ bool AutoDownloadRule::accepts(const QVariantHash &articleData)
|
|||||||
|
|
||||||
AutoDownloadRule &AutoDownloadRule::operator=(const AutoDownloadRule &other)
|
AutoDownloadRule &AutoDownloadRule::operator=(const AutoDownloadRule &other)
|
||||||
{
|
{
|
||||||
m_dataPtr = other.m_dataPtr;
|
if (this != &other)
|
||||||
|
{
|
||||||
|
m_dataPtr = other.m_dataPtr;
|
||||||
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user