diff options
author | Matthias Clasen <mclasen@redhat.com> | 2021-12-01 23:03:52 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-12-01 23:33:41 -0500 |
commit | 169d411a5611be160e10334cceffd9ee300df3d1 (patch) | |
tree | 9d73c8dee575db908300b6dba934c160430d9a32 /pango | |
parent | f2f9e410f295a326a81db8f2ae12889f4e4244b9 (diff) | |
download | pango-169d411a5611be160e10334cceffd9ee300df3d1.tar.gz |
layout: Call pango_tab_array_sort
We want to optimize access to tab stops,
and will assume they are ordered.
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pango-layout.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/pango/pango-layout.c b/pango/pango-layout.c index fc8cc212..27755d67 100644 --- a/pango/pango-layout.c +++ b/pango/pango-layout.c @@ -1032,10 +1032,13 @@ pango_layout_set_tabs (PangoLayout *layout, if (tabs != layout->tabs) { - if (layout->tabs) - pango_tab_array_free (layout->tabs); + g_clear_pointer (&layout->tabs, pango_tab_array_free); - layout->tabs = tabs ? pango_tab_array_copy (tabs) : NULL; + if (tabs) + { + layout->tabs = pango_tab_array_copy (tabs); + pango_tab_array_sort (layout->tabs); + } layout_changed (layout); } |