1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:37:37 +00:00

LibWeb: Use from_deprecated_fly_string() instead of from_utf8()

Use FlyString::from_deprecated_fly_string() in these instances instead
of FlyString::from_utf8(). As we convert to new FlyString/String we want
to be aware of these potential unnecessary allocations.
This commit is contained in:
Kenneth Myhra 2023-03-09 18:07:49 +01:00 committed by Linus Groh
parent e28a6d5da4
commit be958a14cf
4 changed files with 7 additions and 7 deletions

View file

@ -528,7 +528,7 @@ static void paint_text_fragment(PaintContext& context, Layout::TextNode const& t
auto& font = fragment.layout_node().font();
auto scaled_font = [&]() -> RefPtr<Gfx::Font const> {
auto device_font_pt_size = context.enclosing_device_pixels(font.presentation_size());
FontSelector font_selector = { FlyString::from_utf8(font.family()).release_value_but_fixme_should_propagate_errors(), static_cast<float>(device_font_pt_size.value()), font.weight(), font.width(), font.slope() };
FontSelector font_selector = { FlyString::from_deprecated_fly_string(font.family()).release_value_but_fixme_should_propagate_errors(), static_cast<float>(device_font_pt_size.value()), font.weight(), font.width(), font.slope() };
if (auto cached_font = FontCache::the().get(font_selector)) {
return cached_font;
}