mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-23 16:58:06 -06:00
Prevent self-assignment in assignment operator
This commit is contained in:
@@ -88,7 +88,10 @@ TorrentInfo::TorrentInfo(const TorrentInfo &other)
|
||||
|
||||
TorrentInfo &TorrentInfo::operator=(const TorrentInfo &other)
|
||||
{
|
||||
m_nativeInfo = other.m_nativeInfo;
|
||||
if (this != &other)
|
||||
{
|
||||
m_nativeInfo = other.m_nativeInfo;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user