Simplify code

This commit is contained in:
Chocobo1
2023-05-05 12:31:02 +08:00
parent 79e85d01fa
commit 9a00839a75
7 changed files with 11 additions and 12 deletions

View File

@@ -93,7 +93,7 @@ BitTorrent::InfoHash::operator WrappedType() const
BitTorrent::TorrentID BitTorrent::TorrentID::fromString(const QString &hashString)
{
return TorrentID(BaseType::fromString(hashString));
return {BaseType::fromString(hashString)};
}
BitTorrent::TorrentID BitTorrent::TorrentID::fromInfoHash(const BitTorrent::InfoHash &infoHash)
@@ -103,7 +103,7 @@ BitTorrent::TorrentID BitTorrent::TorrentID::fromInfoHash(const BitTorrent::Info
BitTorrent::TorrentID BitTorrent::TorrentID::fromSHA1Hash(const SHA1Hash &hash)
{
return TorrentID(hash);
return {hash};
}
BitTorrent::TorrentID BitTorrent::TorrentID::fromSHA256Hash(const SHA256Hash &hash)