mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-05 05:18:01 +02:00
[cairo-scaled-font-subsets] Shortcut empty subset.
If the font_subset if empty, avoid allocating zero bytes and iterating over the empty hash table.
This commit is contained in:
parent
c175cf7b83
commit
5b2b008048
1 changed files with 4 additions and 0 deletions
|
|
@ -618,6 +618,10 @@ _cairo_scaled_font_subsets_foreach_internal (cairo_scaled_font_subsets_t
|
|||
collection.glyphs_size = font_subsets->max_glyphs_per_scaled_subset_used;
|
||||
else
|
||||
collection.glyphs_size = font_subsets->max_glyphs_per_unscaled_subset_used;
|
||||
|
||||
if (! collection.glyphs_size)
|
||||
return CAIRO_STATUS_SUCCESS;
|
||||
|
||||
collection.glyphs = malloc (collection.glyphs_size * sizeof(unsigned long));
|
||||
if (collection.glyphs == NULL)
|
||||
return CAIRO_STATUS_NO_MEMORY;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue