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

AK+Kernel: StringView hash map Traits should not set peek type to String

This typo / bug in the Traits<T> implementation for StringView caused
AK::HashMap methods to return a `String` when looking up values out of
a hash map of type HashTable<StringView,StringView>.

This change fixes the typo, and fixes the only consumer, the kernel
Commandline class.
This commit is contained in:
Brian Gianforcaro 2021-08-14 23:49:17 -07:00 committed by Andreas Kling
parent 9bdb44c5d2
commit e9d8f158a1
3 changed files with 8 additions and 8 deletions

View file

@ -55,7 +55,7 @@ public:
};
[[nodiscard]] const String& string() const { return m_string; }
Optional<String> lookup(const StringView& key) const;
Optional<StringView> lookup(const StringView& key) const;
[[nodiscard]] bool contains(const StringView& key) const;
[[nodiscard]] bool is_boot_profiling_enabled() const;
@ -76,9 +76,9 @@ public:
[[nodiscard]] bool disable_usb() const;
[[nodiscard]] bool disable_virtio() const;
[[nodiscard]] AHCIResetMode ahci_reset_mode() const;
[[nodiscard]] String userspace_init() const;
[[nodiscard]] StringView userspace_init() const;
[[nodiscard]] Vector<String> userspace_init_args() const;
[[nodiscard]] String root_device() const;
[[nodiscard]] StringView root_device() const;
[[nodiscard]] size_t switch_to_tty() const;
private: