[set] Simplify page_t::next/prev()
This commit is contained in:
parent
4394ee1f1d
commit
9449cfeefd
|
@ -145,10 +145,10 @@ struct hb_set_t
|
||||||
unsigned int j = m & ELT_MASK;
|
unsigned int j = m & ELT_MASK;
|
||||||
|
|
||||||
const elt_t vv = v[i] & ~((elt_t (1) << j) - 1);
|
const elt_t vv = v[i] & ~((elt_t (1) << j) - 1);
|
||||||
for (const elt_t *p = &vv; i < len (); p = &v[++i])
|
for (elt_t p = vv; i < len (); p = v[++i])
|
||||||
if (*p)
|
if (p)
|
||||||
{
|
{
|
||||||
*codepoint = i * ELT_BITS + elt_get_min (*p);
|
*codepoint = i * ELT_BITS + elt_get_min (p);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,16 +171,16 @@ struct hb_set_t
|
||||||
((elt_t (1) << (j + 1)) - 1) :
|
((elt_t (1) << (j + 1)) - 1) :
|
||||||
(elt_t) -1;
|
(elt_t) -1;
|
||||||
const elt_t vv = v[i] & mask;
|
const elt_t vv = v[i] & mask;
|
||||||
const elt_t *p = &vv;
|
elt_t p = vv;
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
if (*p)
|
if (p)
|
||||||
{
|
{
|
||||||
*codepoint = i * ELT_BITS + elt_get_max (*p);
|
*codepoint = i * ELT_BITS + elt_get_max (p);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if ((int) i <= 0) break;
|
if ((int) i <= 0) break;
|
||||||
p = &v[--i];
|
p = v[--i];
|
||||||
}
|
}
|
||||||
|
|
||||||
*codepoint = INVALID;
|
*codepoint = INVALID;
|
||||||
|
|
Loading…
Reference in New Issue