1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 03:37:45 +00:00

LibTLS: Avoid unnecessary HashMap copies, improve const-correctness

This commit is contained in:
Ben Wiederhake 2023-05-13 20:51:24 +02:00 committed by Jelle Raaijmakers
parent f866c80222
commit 2bb2a7097d
4 changed files with 11 additions and 11 deletions

View file

@ -192,29 +192,29 @@ struct BasicConstraints {
class RelativeDistinguishedName {
public:
ErrorOr<String> to_string();
ErrorOr<String> to_string() const;
ErrorOr<AK::HashSetResult> set(String key, String value)
{
return m_members.try_set(key, value);
}
Optional<String> get(StringView key)
Optional<String> get(StringView key) const
{
return m_members.get(key);
}
Optional<String> get(AttributeType key)
Optional<String> get(AttributeType key) const
{
return m_members.get(enum_value(key));
}
Optional<String> get(ObjectClass key)
Optional<String> get(ObjectClass key) const
{
return m_members.get(enum_value(key));
}
String common_name()
String common_name() const
{
auto entry = get(AttributeType::Cn);
if (entry.has_value()) {