From 9449cfeefd7e3b761c8035c45330abd7a5201604 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sun, 15 Aug 2021 11:35:33 -0600 Subject: [PATCH] [set] Simplify page_t::next/prev() --- src/hb-set.hh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hb-set.hh b/src/hb-set.hh index e55337407..789cbcfa3 100644 --- a/src/hb-set.hh +++ b/src/hb-set.hh @@ -145,10 +145,10 @@ struct hb_set_t unsigned int j = m & ELT_MASK; const elt_t vv = v[i] & ~((elt_t (1) << j) - 1); - for (const elt_t *p = &vv; i < len (); p = &v[++i]) - if (*p) + for (elt_t p = vv; i < len (); p = v[++i]) + if (p) { - *codepoint = i * ELT_BITS + elt_get_min (*p); + *codepoint = i * ELT_BITS + elt_get_min (p); return true; } @@ -171,16 +171,16 @@ struct hb_set_t ((elt_t (1) << (j + 1)) - 1) : (elt_t) -1; const elt_t vv = v[i] & mask; - const elt_t *p = &vv; + elt_t p = vv; while (true) { - if (*p) + if (p) { - *codepoint = i * ELT_BITS + elt_get_max (*p); + *codepoint = i * ELT_BITS + elt_get_max (p); return true; } if ((int) i <= 0) break; - p = &v[--i]; + p = v[--i]; } *codepoint = INVALID;