From e68b76bc145fc3c2eb82f57b1a01dacbd559af1c Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Tue, 4 Jul 2023 09:40:36 -0500 Subject: [PATCH] perf: use small::unordered_map in tr_torrent::primary_mime_type() (#5722) --- libtransmission/torrent.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libtransmission/torrent.cc b/libtransmission/torrent.cc index e94233dda..890f8ef28 100644 --- a/libtransmission/torrent.cc +++ b/libtransmission/torrent.cc @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -27,6 +26,8 @@ #include #include +#include + #include "libtransmission/transmission.h" #include "libtransmission/announcer.h" @@ -2248,7 +2249,7 @@ std::string_view tr_torrent::primary_mime_type() const // count up how many bytes there are for each mime-type in the torrent // NB: get_mime_type_for_filename() always returns the same ptr for a // mime_type, so its raw pointer can be used as a key. - auto size_per_mime_type = std::unordered_map{}; + auto size_per_mime_type = small::unordered_map{}; for (tr_file_index_t i = 0, n = this->file_count(); i < n; ++i) { auto const mime_type = tr_get_mime_type_for_filename(this->file_subpath(i));