From a0367aa43b89b9714a86475407aef5702ae9e79d Mon Sep 17 00:00:00 2001 From: Lenny Maiorani Date: Wed, 16 Mar 2022 18:26:49 -0600 Subject: DevTools+LibJS+LibWeb: Change class_name to use StringView This helps make the overall codebase consistent. `class_name()` in `Kernel` is always `StringView`, but not elsewhere. Additionally, this results in the `strlen` (which needs to be done when printing or other operations) always being computed at compile-time. --- Userland/Libraries/LibJS/Runtime/PrimitiveString.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'Userland/Libraries/LibJS/Runtime/PrimitiveString.h') diff --git a/Userland/Libraries/LibJS/Runtime/PrimitiveString.h b/Userland/Libraries/LibJS/Runtime/PrimitiveString.h index 5eaae45562..49b136bcd6 100644 --- a/Userland/Libraries/LibJS/Runtime/PrimitiveString.h +++ b/Userland/Libraries/LibJS/Runtime/PrimitiveString.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include #include #include @@ -33,7 +34,7 @@ public: Optional get(GlobalObject&, PropertyKey const&) const; private: - virtual const char* class_name() const override { return "PrimitiveString"; } + virtual StringView class_name() const override { return "PrimitiveString"sv; } mutable String m_utf8_string; mutable bool m_has_utf8_string { false }; -- cgit v1.2.3