*: use transparent comparison for std::{map,set} with std::string keys
This avoids many std::string temporaries for lookups.
This commit is contained in:
@@ -52,7 +52,7 @@ struct InputPlugin {
|
||||
/**
|
||||
* return a set of supported protocols
|
||||
*/
|
||||
std::set<std::string> (*protocols)() noexcept;
|
||||
std::set<std::string, std::less<>> (*protocols)() noexcept;
|
||||
|
||||
/**
|
||||
* Prepare a #RemoteTagScanner. The operation must be started
|
||||
|
||||
@@ -589,10 +589,10 @@ input_curl_open(const char *url, Mutex &mutex)
|
||||
return CurlInputStream::Open(url, {}, mutex);
|
||||
}
|
||||
|
||||
static std::set<std::string>
|
||||
static std::set<std::string, std::less<>>
|
||||
input_curl_protocols() noexcept
|
||||
{
|
||||
std::set<std::string> protocols;
|
||||
std::set<std::string, std::less<>> protocols;
|
||||
auto version_info = curl_version_info(CURLVERSION_FIRST);
|
||||
for (auto proto_ptr = version_info->protocols; *proto_ptr != nullptr; proto_ptr++) {
|
||||
if (protocol_is_whitelisted(*proto_ptr)) {
|
||||
|
||||
@@ -57,12 +57,12 @@ input_ffmpeg_init(EventLoop &, const ConfigBlock &)
|
||||
throw PluginUnavailable("No protocol");
|
||||
}
|
||||
|
||||
static std::set<std::string>
|
||||
static std::set<std::string, std::less<>>
|
||||
input_ffmpeg_protocols() noexcept
|
||||
{
|
||||
void *opaque = nullptr;
|
||||
const char* protocol;
|
||||
std::set<std::string> protocols;
|
||||
std::set<std::string, std::less<>> protocols;
|
||||
while ((protocol = avio_enum_protocols(&opaque, 0))) {
|
||||
if (StringIsEqual(protocol, "hls")) {
|
||||
/* just "hls://" doesn't work, but these do
|
||||
|
||||
Reference in New Issue
Block a user