mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +00:00
AK: Add FlyString::from_deprecated_fly_string()
Let's add FlyString::from_deprecated_fly_string() so we can use it instead of FlyString::from_utf8(). This will make it easier to detect potential unncessary allocations as we transfer to FlyString.
This commit is contained in:
committed by
Linus Groh
parent
41b8d81d49
commit
e28a6d5da4
@@ -168,6 +168,11 @@ DeprecatedFlyString FlyString::to_deprecated_fly_string() const
|
||||
return DeprecatedFlyString(bytes_as_string_view());
|
||||
}
|
||||
|
||||
ErrorOr<FlyString> FlyString::from_deprecated_fly_string(DeprecatedFlyString const& deprecated_fly_string)
|
||||
{
|
||||
return FlyString::from_utf8(deprecated_fly_string.view());
|
||||
}
|
||||
|
||||
unsigned Traits<FlyString>::hash(FlyString const& fly_string)
|
||||
{
|
||||
return fly_string.hash();
|
||||
|
||||
Reference in New Issue
Block a user