1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 16:47:44 +00:00

LibTLS: Move Strings when creating RelativeDistinguishedNames

Also cleans up the organizational_unit() helper to use `value_or({})`
instead of doing the same thing manually.
This commit is contained in:
Hendiadyoin1 2024-03-01 14:16:54 +01:00 committed by Andrew Kaster
parent f7329f89aa
commit e1c663ba27
2 changed files with 4 additions and 9 deletions

View file

@ -195,7 +195,7 @@ public:
ErrorOr<AK::HashSetResult> set(String key, String value)
{
return m_members.try_set(key, value);
return m_members.try_set(move(key), move(value));
}
Optional<String> get(StringView key) const
@ -223,14 +223,9 @@ public:
return String();
}
String organizational_unit()
String organizational_unit() const
{
auto entry = get(AttributeType::Ou);
if (entry.has_value()) {
return entry.value();
}
return String();
return get(AttributeType::Ou).value_or({});
}
private: