*: use transparent comparison for std::{map,set} with std::string keys
This avoids many std::string temporaries for lookups.
This commit is contained in:
@@ -103,12 +103,12 @@ AudioOutputControl::GetMixer() const noexcept
|
||||
return output ? output->mixer : nullptr;
|
||||
}
|
||||
|
||||
std::map<std::string, std::string>
|
||||
std::map<std::string, std::string, std::less<>>
|
||||
AudioOutputControl::GetAttributes() const noexcept
|
||||
{
|
||||
return output
|
||||
? output->GetAttributes()
|
||||
: std::map<std::string, std::string>{};
|
||||
: std::map<std::string, std::string, std::less<>>{};
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -371,7 +371,7 @@ public:
|
||||
|
||||
void BeginDestroy() noexcept;
|
||||
|
||||
std::map<std::string, std::string> GetAttributes() const noexcept;
|
||||
std::map<std::string, std::string, std::less<>> GetAttributes() const noexcept;
|
||||
void SetAttribute(std::string &&name, std::string &&value);
|
||||
|
||||
/**
|
||||
|
||||
@@ -33,7 +33,7 @@ FilteredAudioOutput::SupportsPause() const noexcept
|
||||
return output->SupportsPause();
|
||||
}
|
||||
|
||||
std::map<std::string, std::string>
|
||||
std::map<std::string, std::string, std::less<>>
|
||||
FilteredAudioOutput::GetAttributes() const noexcept
|
||||
{
|
||||
return output->GetAttributes();
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
[[gnu::pure]]
|
||||
bool SupportsPause() const noexcept;
|
||||
|
||||
std::map<std::string, std::string> GetAttributes() const noexcept;
|
||||
std::map<std::string, std::string, std::less<>> GetAttributes() const noexcept;
|
||||
void SetAttribute(std::string &&name, std::string &&value);
|
||||
|
||||
/**
|
||||
|
||||
@@ -49,7 +49,7 @@ public:
|
||||
*
|
||||
* This method must be thread-safe.
|
||||
*/
|
||||
virtual std::map<std::string, std::string> GetAttributes() const noexcept {
|
||||
virtual std::map<std::string, std::string, std::less<>> GetAttributes() const noexcept {
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
@@ -257,7 +257,7 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
std::map<std::string, std::string> GetAttributes() const noexcept override;
|
||||
std::map<std::string, std::string, std::less<>> GetAttributes() const noexcept override;
|
||||
void SetAttribute(std::string &&name, std::string &&value) override;
|
||||
|
||||
void Enable() override;
|
||||
@@ -444,7 +444,7 @@ AlsaOutput::AlsaOutput(EventLoop &_loop, const ConfigBlock &block)
|
||||
allowed_formats = Alsa::AllowedFormat::ParseList(allowed_formats_string);
|
||||
}
|
||||
|
||||
std::map<std::string, std::string>
|
||||
std::map<std::string, std::string, std::less<>>
|
||||
AlsaOutput::GetAttributes() const noexcept
|
||||
{
|
||||
const std::scoped_lock<Mutex> lock(attributes_mutex);
|
||||
|
||||
Reference in New Issue
Block a user