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
Notes: sideshowbarker 2024-07-18 12:18:21 +09:00

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;