summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2022-08-27 20:52:06 -0400
committerMatthias Clasen <mclasen@redhat.com>2022-08-27 20:52:06 -0400
commitda5b42263675acc7e615b8893a3a716646e910db (patch)
treec19e9caf133b53f97ad8f155129eaef068009b19
parent17f2d869f876ea10262ff6841b29fe86463a0d70 (diff)
downloadpango-da5b42263675acc7e615b8893a3a716646e910db.tar.gz
itemize: Use pango_font_get_variantstrdup-avoidance
This avoids the unnecessary copy of the fonts font description, just to extract the variant.
-rw-r--r--pango/itemize.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/pango/itemize.c b/pango/itemize.c
index 728ad7d9..cf9d6a8f 100644
--- a/pango/itemize.c
+++ b/pango/itemize.c
@@ -1296,17 +1296,10 @@ variant_supported (PangoItem *item,
static PangoVariant
get_font_variant (PangoItem *item)
{
- PangoFontDescription *desc;
- PangoVariant variant = PANGO_VARIANT_NORMAL;
-
if (item->analysis.font)
- {
- desc = pango_font_describe (item->analysis.font);
- variant = pango_font_description_get_variant (desc);
- pango_font_description_free (desc);
- }
+ return pango_font_get_variant (item->analysis.font);
- return variant;
+ return PANGO_VARIANT_NORMAL;
}
static PangoTextTransform