mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-13 04:52:23 +00:00
LibWeb: Use FlyString in FontCache keys
This commit is contained in:
parent
82444048de
commit
4ec8b9f6ee
Notes:
sideshowbarker
2024-07-19 06:05:52 +09:00
Author: https://github.com/awesomekling
Commit: 4ec8b9f6ee
1 changed files with 4 additions and 3 deletions
|
@ -26,13 +26,14 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <AK/FlyString.h>
|
||||||
#include <AK/HashMap.h>
|
#include <AK/HashMap.h>
|
||||||
#include <AK/String.h>
|
#include <AK/String.h>
|
||||||
#include <LibGfx/Forward.h>
|
#include <LibGfx/Forward.h>
|
||||||
|
|
||||||
struct FontSelector {
|
struct FontSelector {
|
||||||
String family;
|
FlyString family;
|
||||||
String weight;
|
FlyString weight;
|
||||||
|
|
||||||
bool operator==(const FontSelector& other) const
|
bool operator==(const FontSelector& other) const
|
||||||
{
|
{
|
||||||
|
@ -54,6 +55,6 @@ public:
|
||||||
void set(const FontSelector&, NonnullRefPtr<Gfx::Font>);
|
void set(const FontSelector&, NonnullRefPtr<Gfx::Font>);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
FontCache() {}
|
FontCache() { }
|
||||||
mutable HashMap<FontSelector, NonnullRefPtr<Gfx::Font>> m_fonts;
|
mutable HashMap<FontSelector, NonnullRefPtr<Gfx::Font>> m_fonts;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue