mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Return a constant reference from JsonValue::as_string
Rather than making a copy of the held string, this returns a reference so that expressions like the following: do_something(json.as_string().view()); are not disallowed once `ByteString::view() &&` is deleted.
This commit is contained in:
parent
6d38d55fc8
commit
c7ea710b55
Notes:
sideshowbarker
2024-07-17 09:47:09 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/c7ea710b55 Pull-request: https://github.com/SerenityOS/serenity/pull/23830 Reviewed-by: https://github.com/shannonbooth ✅
1 changed files with 1 additions and 1 deletions
|
@ -128,7 +128,7 @@ public:
|
|||
return m_value.get<bool>();
|
||||
}
|
||||
|
||||
ByteString as_string() const
|
||||
ByteString const& as_string() const
|
||||
{
|
||||
return m_value.get<ByteString>();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue