mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:57:44 +00:00
AK: Return Optional<T&> from HashMap<..., T>::get()
This avoids a useless copy of the value, as most of the users (except one) actually just need a reference to the value.
This commit is contained in:
parent
1a74895680
commit
33e27c545e
2 changed files with 4 additions and 4 deletions
|
@ -16,8 +16,8 @@ namespace AK {
|
|||
|
||||
template<typename T>
|
||||
struct GenericTraits {
|
||||
using PeekType = T;
|
||||
using ConstPeekType = T;
|
||||
using PeekType = T&;
|
||||
using ConstPeekType = T const&;
|
||||
static constexpr bool is_trivial() { return false; }
|
||||
static constexpr bool equals(const T& a, const T& b) { return a == b; }
|
||||
template<Concepts::HashCompatible<T> U>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue