mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:17:46 +00:00
LibCore: Don't needlessly use StringView in Core::Object APIs
Taking a StringView parameter that gets immediately converted to a String anyway is silly. Just take a String directly instead. This pattern is the main reason we have the "StringView internal StringImpl pointer" optimization, and I suspect that we can throw that whole thing out if we make a couple more patches like this.
This commit is contained in:
parent
73aa59ccf1
commit
942a5afd23
2 changed files with 5 additions and 5 deletions
|
@ -75,7 +75,7 @@ public:
|
|||
virtual const char* class_name() const = 0;
|
||||
|
||||
const String& name() const { return m_name; }
|
||||
void set_name(const StringView& name) { m_name = name; }
|
||||
void set_name(String name) { m_name = move(name); }
|
||||
|
||||
NonnullRefPtrVector<Object>& children() { return m_children; }
|
||||
const NonnullRefPtrVector<Object>& children() const { return m_children; }
|
||||
|
@ -120,8 +120,8 @@ public:
|
|||
|
||||
void save_to(JsonObject&);
|
||||
|
||||
bool set_property(const StringView& name, const JsonValue& value);
|
||||
JsonValue property(const StringView& name) const;
|
||||
bool set_property(String const& name, const JsonValue& value);
|
||||
JsonValue property(String const& name) const;
|
||||
const HashMap<String, NonnullOwnPtr<Property>>& properties() const { return m_properties; }
|
||||
|
||||
static IntrusiveList<Object, RawPtr<Object>, &Object::m_all_objects_list_node>& all_objects();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue