*: use transparent comparison for std::{map,set} with std::string keys
This avoids many std::string temporaries for lookups.
This commit is contained in:
@@ -38,7 +38,7 @@ struct DecoderPlugin {
|
||||
/**
|
||||
* Return a set of supported protocols.
|
||||
*/
|
||||
std::set<std::string> (*protocols)() noexcept = nullptr;
|
||||
std::set<std::string, std::less<>> (*protocols)() noexcept = nullptr;
|
||||
|
||||
/**
|
||||
* Decode an URI with a protocol listed in protocols().
|
||||
@@ -138,7 +138,7 @@ struct DecoderPlugin {
|
||||
return copy;
|
||||
}
|
||||
|
||||
constexpr auto WithProtocols(std::set<std::string> (*_protocols)() noexcept,
|
||||
constexpr auto WithProtocols(std::set<std::string, std::less<>> (*_protocols)() noexcept,
|
||||
void (*_uri_decode)(DecoderClient &client, const char *uri)) const noexcept {
|
||||
auto copy = *this;
|
||||
copy.protocols = _protocols;
|
||||
|
@@ -672,10 +672,10 @@ ffmpeg_uri_decode(DecoderClient &client, const char *uri)
|
||||
FfmpegDecode(client, nullptr, *format_context);
|
||||
}
|
||||
|
||||
static std::set<std::string>
|
||||
static std::set<std::string, std::less<>>
|
||||
ffmpeg_protocols() noexcept
|
||||
{
|
||||
std::set<std::string> protocols;
|
||||
std::set<std::string, std::less<>> protocols;
|
||||
|
||||
const AVInputFormat *format = nullptr;
|
||||
void *opaque = nullptr;
|
||||
|
Reference in New Issue
Block a user