1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-22 22:20:39 +00:00

fix: blocklists allocate more memory than they need (#4953)

This commit is contained in:
Charles Kerr 2023-02-19 09:20:23 -06:00 committed by GitHub
parent 671f835228
commit ed8133520f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -390,7 +390,7 @@ void Blocklist::ensureLoaded() const
} }
auto range = address_range_t{}; auto range = address_range_t{};
rules_.reserve(file_info->size - std::size(BinContentsPrefix) / sizeof(address_range_t)); rules_.reserve((file_info->size - std::size(BinContentsPrefix)) / sizeof(address_range_t));
while (in.read(reinterpret_cast<char*>(&range), sizeof(range))) while (in.read(reinterpret_cast<char*>(&range), sizeof(range)))
{ {
rules_.emplace_back(range); rules_.emplace_back(range);