summaryrefslogtreecommitdiff
path: root/pango/pangofc-fontmap.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-08-15 15:28:40 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-08-15 15:28:40 -0400
commite9703ea37a471fb1f61f57e644c78a6a411ad5d6 (patch)
tree3792a1e5631c2559de596923ddbf5bc8ba2bffa6 /pango/pangofc-fontmap.c
parent3eaff0ed87763e3a7d1e36541cbc0fdd7df58269 (diff)
downloadpango-e9703ea37a471fb1f61f57e644c78a6a411ad5d6.tar.gz
Speed up font format filtering
We were needlessly duplicating patters when we could have just referenced them.
Diffstat (limited to 'pango/pangofc-fontmap.c')
-rw-r--r--pango/pangofc-fontmap.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index ec504094..6d7ae3aa 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -848,7 +848,10 @@ filter_fontset_by_format (FcFontSet *fontset)
for (i = 0; i < fontset->nfont; i++)
{
if (pango_fc_is_supported_font_format (fontset->fonts[i]))
- FcFontSetAdd (result, FcPatternDuplicate (fontset->fonts[i]));
+ {
+ FcPatternReference (fontset->fonts[i]);
+ FcFontSetAdd (result, fontset->fonts[i]);
+ }
}
return result;