[bit-set-invertible] Rewrite get_min/max() in terms of next/previous()
This commit is contained in:
parent
f09d5ed0f5
commit
eec1a25e71
|
@ -262,9 +262,17 @@ struct hb_bit_set_invertible_t
|
||||||
{ return inverted ? INVALID - s.get_population () : s.get_population (); }
|
{ return inverted ? INVALID - s.get_population () : s.get_population (); }
|
||||||
|
|
||||||
hb_codepoint_t get_min () const
|
hb_codepoint_t get_min () const
|
||||||
{ return s.get_min (inverted); }
|
{
|
||||||
|
hb_codepoint_t v = INVALID;
|
||||||
|
next (&v);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
hb_codepoint_t get_max () const
|
hb_codepoint_t get_max () const
|
||||||
{ return unlikely (inverted) ? /*XXX*/ INVALID - 1 : s.get_max (); }
|
{
|
||||||
|
hb_codepoint_t v = INVALID;
|
||||||
|
previous (&v);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
static constexpr hb_codepoint_t INVALID = hb_bit_set_t::INVALID;
|
static constexpr hb_codepoint_t INVALID = hb_bit_set_t::INVALID;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue