fixup! fix: update partial file suffix after verifying torrent (#6871) (#7072)

This commit is contained in:
Yat Ho 2024-10-14 20:43:18 +08:00 committed by GitHub
parent c7c8c47850
commit f37b8d9bf5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

View File

@ -328,7 +328,8 @@ struct tr_torrent
[[nodiscard]] auto has_file(tr_file_index_t file) const
{
return completion_.has_blocks(block_span_for_file(file));
auto const span = byte_span_for_file(file);
return completion_.count_has_bytes_in_span(span) == span.end - span.begin;
}
[[nodiscard]] auto has_piece(tr_piece_index_t piece) const
@ -1224,7 +1225,7 @@ private:
// must be called after the torrent's announce list changes.
void on_announce_list_changed();
[[nodiscard]] TR_CONSTEXPR20 auto byte_span_for_file(tr_file_index_t file) const
[[nodiscard]] TR_CONSTEXPR20 tr_byte_span_t byte_span_for_file(tr_file_index_t file) const
{
return fpm_.byte_span_for_file(file);
}