From cd12b182ca54627ec708fa303fdae5b8b7a20392 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sun, 13 Jun 2021 12:00:01 +0200 Subject: [PATCH] AK: Add FlyString::from_fly_impl() This allows you to create a FlyString directly from a known-fly StringImpl instance. --- AK/FlyString.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AK/FlyString.h b/AK/FlyString.h index 26131678495..0e107053e0a 100644 --- a/AK/FlyString.h +++ b/AK/FlyString.h @@ -28,6 +28,14 @@ public: { } + static FlyString from_fly_impl(NonnullRefPtr impl) + { + VERIFY(impl->is_fly()); + FlyString string; + string.m_impl = move(impl); + return string; + } + FlyString& operator=(const FlyString& other) { m_impl = other.m_impl;