1
0
mirror of https://github.com/SerenityOS/serenity synced 2024-07-05 21:34:57 +00:00

AK: Add FlyString::from_fly_impl()

This allows you to create a FlyString directly from a known-fly
StringImpl instance.
This commit is contained in:
Andreas Kling 2021-06-13 12:00:01 +02:00
parent 240d2f88d3
commit cd12b182ca

View File

@ -28,6 +28,14 @@ public:
{
}
static FlyString from_fly_impl(NonnullRefPtr<StringImpl> impl)
{
VERIFY(impl->is_fly());
FlyString string;
string.m_impl = move(impl);
return string;
}
FlyString& operator=(const FlyString& other)
{
m_impl = other.m_impl;