perf: use small:set in tr_file_piece_map::reset() (#5720)
This commit is contained in:
parent
d76d26a580
commit
7c7771a12b
|
@ -3,9 +3,10 @@
|
|||
// or any future license endorsed by Mnemosyne LLC.
|
||||
// License text can be found in the licenses/ folder.
|
||||
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include <small/set.hpp>
|
||||
|
||||
#include "libtransmission/transmission.h"
|
||||
|
||||
#include "libtransmission/block-info.h"
|
||||
|
@ -21,7 +22,8 @@ void tr_file_piece_map::reset(tr_block_info const& block_info, uint64_t const* f
|
|||
file_pieces_.resize(n_files);
|
||||
file_pieces_.shrink_to_fit();
|
||||
|
||||
auto edge_pieces = std::set<tr_piece_index_t>{};
|
||||
auto edge_pieces = small::set<tr_piece_index_t, 1024U>{};
|
||||
edge_pieces.reserve(n_files * 2U);
|
||||
|
||||
uint64_t offset = 0;
|
||||
for (tr_file_index_t i = 0; i < n_files; ++i)
|
||||
|
|
Loading…
Reference in New Issue