From 1930760bc2c2b4185a772e38b6ecc174a95a47b2 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 6 Feb 2023 15:54:09 -0700 Subject: [PATCH] [buffer] Fix up previous commit https://github.com/harfbuzz/harfbuzz/commit/85be877925ddbf34f74a1229f3ca1716bb6170dc#commitcomment-99547060 --- src/hb-buffer.hh | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/hb-buffer.hh b/src/hb-buffer.hh index e124f3679..5a43cabcb 100644 --- a/src/hb-buffer.hh +++ b/src/hb-buffer.hh @@ -584,8 +584,8 @@ struct hb_buffer_t if (unlikely (start == end)) return; - unsigned cluster_first = info[start].cluster; - unsigned cluster_last = info[end - 1].cluster; + unsigned cluster_first = infos[start].cluster; + unsigned cluster_last = infos[end - 1].cluster; if (cluster_level == HB_BUFFER_CLUSTER_LEVEL_CHARACTERS || (cluster != cluster_first && cluster != cluster_last)) @@ -604,20 +604,18 @@ struct hb_buffer_t if (cluster == cluster_first) { for (unsigned int i = end; start < i && infos[i - 1].cluster != cluster_first; i--) - if (cluster != infos[i - 1].cluster) - { - scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GLYPH_FLAGS; - infos[i - 1].mask |= mask; - } + { + scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GLYPH_FLAGS; + infos[i - 1].mask |= mask; + } } else /* cluster == cluster_last */ { for (unsigned int i = start; i < end && infos[i].cluster != cluster_last; i++) - if (cluster != infos[i].cluster) - { - scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GLYPH_FLAGS; - infos[i].mask |= mask; - } + { + scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GLYPH_FLAGS; + infos[i].mask |= mask; + } } } unsigned