AK: Don't implicitly convert Optional<T&> to Optional<T>

C++ will jovially select the implicit conversion operator, even if it's
complete bogus, such as for unknown-size types or non-destructible
types. Therefore, all such conversions (which incur a copy) must
(unfortunately) be explicit so that non-copyable types continue to work.
This commit is contained in:
kleines Filmröllchen
2024-09-10 21:16:49 +02:00
committed by Tim Schumacher
parent dfe3cfa0ba
commit a3077203fe
30 changed files with 72 additions and 37 deletions

View File

@@ -41,7 +41,7 @@ bool ModuleMap::is(URL::URL const& url, ByteString const& type, EntryType entry_
Optional<ModuleMap::Entry> ModuleMap::get(URL::URL const& url, ByteString const& type) const
{
return m_values.get({ url, type });
return m_values.get({ url, type }).copy();
}
AK::HashSetResult ModuleMap::set(URL::URL const& url, ByteString const& type, Entry entry)