mirror of
https://github.com/arabianq/pipewire-soundpad.git
synced 2026-09-20 22:23:31 +00:00
perf: Optimize system font loading by replacing concat() with chain() (#189)
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
google-labs-jules[bot]
parent
7ad69243cc
commit
17146d2ce6
@@ -389,9 +389,13 @@ fn load_system_fonts(fonts: &mut FontDefinitions) -> Result<()> {
|
||||
let (_, ja_sans) = find_for_locale("ja", FontStyle::Sans);
|
||||
let (_, ar_sans) = find_for_locale("ar", FontStyle::Sans);
|
||||
|
||||
let system_fonts = [en_sans, en_serif, ja_sans, ar_sans].concat();
|
||||
let system_fonts = en_sans
|
||||
.into_iter()
|
||||
.chain(en_serif)
|
||||
.chain(ja_sans)
|
||||
.chain(ar_sans);
|
||||
|
||||
for font in system_fonts.iter().rev() {
|
||||
for font in system_fonts.rev() {
|
||||
let font_bytes = match &font.source {
|
||||
FoundFontSource::Path(path) => fs::read(path)?,
|
||||
FoundFontSource::Bytes(bytes) => bytes.to_vec(),
|
||||
|
||||
Reference in New Issue
Block a user