chore: fix reference to temporary (#6484)
This commit is contained in:
parent
4cfd9f0c9e
commit
23eb0ef92d
|
@ -128,7 +128,7 @@ tr_file_piece_map::file_span_t tr_file_piece_map::file_span_for_piece(tr_piece_i
|
|||
{
|
||||
static constexpr auto Compare = CompareToSpan<tr_piece_index_t>{};
|
||||
auto const begin = std::begin(file_pieces_);
|
||||
auto const& [equal_begin, equal_end] = std::equal_range(begin, std::end(file_pieces_), piece, Compare);
|
||||
auto const [equal_begin, equal_end] = std::equal_range(begin, std::end(file_pieces_), piece, Compare);
|
||||
return { static_cast<tr_file_index_t>(equal_begin - begin), static_cast<tr_file_index_t>(equal_end - begin) };
|
||||
}
|
||||
|
||||
|
|
|
@ -2174,8 +2174,7 @@ void tr_torrent::on_piece_completed(tr_piece_index_t const piece)
|
|||
set_needs_completeness_check();
|
||||
|
||||
// if this piece completes any file, invoke the fileCompleted func for it
|
||||
auto const [file_begin, file_end] = fpm_.file_span_for_piece(piece);
|
||||
for (auto file = file_begin; file < file_end; ++file)
|
||||
for (auto [file, file_end] = fpm_.file_span_for_piece(piece); file < file_end; ++file)
|
||||
{
|
||||
if (completion_.has_blocks(block_span_for_file(file)))
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue