1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

AK: Add missing GenericTraits<NonnullRefPtr>

This enables us to use keys of type NonnullRefPtr in HashMaps and
HashTables.

This commit also includes fixes in various places that used
HashMap<T, NonnullRefPtr<U>>::get() and expected to get an
Optional<NonnullRefPtr<U>> and now get an Optional<U*>.
This commit is contained in:
Itamar 2021-05-08 12:27:12 +03:00 committed by Andreas Kling
parent 1da0d402b7
commit 8a01167c7d
6 changed files with 20 additions and 7 deletions

View file

@ -7,6 +7,7 @@
#include "FileDB.h"
#include <AK/LexicalPath.h>
#include <AK/NonnullRefPtr.h>
#include <LibCore/File.h>
namespace LanguageServers {
@ -18,7 +19,7 @@ RefPtr<const GUI::TextDocument> FileDB::get(const String& filename) const
if (!document_optional.has_value())
return nullptr;
return document_optional.value();
return adopt_ref(*document_optional.value());
}
RefPtr<GUI::TextDocument> FileDB::get(const String& filename)