Browse Source

Prevent self-assignment in assignment operator

adaptive-webui-19844
Chocobo1 3 years ago
parent
commit
2efd4f2a77
No known key found for this signature in database
GPG Key ID: 210D9C873253A68C
  1. 3
      src/base/bittorrent/torrentinfo.cpp
  2. 3
      src/base/rss/rss_autodownloadrule.cpp

3
src/base/bittorrent/torrentinfo.cpp

@ -88,7 +88,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;
} }

3
src/base/rss/rss_autodownloadrule.cpp

@ -440,7 +440,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…
Cancel
Save