[bit-page] Short-circuit is_subset()

This commit is contained in:
Behdad Esfahbod committed 2023-07-09 09:45:46 -06:00
1 parent 347c1f7013
commit 2f4ed5e939
1 file changed
+4
+4
View File
@@ -226,6 +226,10 @@ struct hb_bit_page_t
}
bool is_subset (const hb_bit_page_t &larger_page) const
{
if (has_population () && larger_page.has_population () &&
population > larger_page.population)
return false;
for (unsigned i = 0; i < len (); i++)
if (~larger_page.v[i] & v[i])
return false;