fix: incorrect magnet size calcuation in tr_completion (#2856)

This commit is contained in:
Charles Kerr 2022-04-01 08:49:54 -05:00 committed by GitHub
parent e64430941f
commit 1f15933fda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -198,6 +198,10 @@ void tr_completion::removePiece(tr_piece_index_t piece)
uint64_t tr_completion::countHasBytesInBlocks(tr_block_span_t span) const
{
auto const [begin, end] = span;
if (begin >= end)
{
return 0;
}
uint64_t n = blocks_.count(begin, end);
n *= tr_block_info::BlockSize;

View File

@ -201,7 +201,7 @@ public:
[[nodiscard]] auto hasMetainfo() const noexcept
{
return completion.hasMetainfo() > 0;
return completion.hasMetainfo();
}
[[nodiscard]] auto hasAll() const