mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-21 18:15:58 +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:
parent
240d2f88d3
commit
cd12b182ca
|
@ -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)
|
FlyString& operator=(const FlyString& other)
|
||||||
{
|
{
|
||||||
m_impl = other.m_impl;
|
m_impl = other.m_impl;
|
||||||
|
|
Loading…
Reference in a new issue