mirror of
https://github.com/transmission/transmission.git
synced 2025-12-20 02:18:42 +00:00
perf: short circuit reset_blocks_bitfield() (#7838)
Co-authored-by: m0xf <m0xf@ya.ru>
This commit is contained in:
@@ -220,7 +220,13 @@ private:
|
||||
{
|
||||
for (auto& candidate : candidates_)
|
||||
{
|
||||
for (auto [begin, i] = candidate.block_span; i > begin; --i)
|
||||
auto const [begin, end] = candidate.block_span;
|
||||
if (requests.count(begin, end) == 0U)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
for (auto i = end; i > begin; --i)
|
||||
{
|
||||
if (auto const block = i - 1U; requests.test(block))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user