mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-23 07:51:10 +01:00
[subset] remove divisions when computing the cost of binary search
This commit is contained in:
1 parent
4d2a362f84
commit
192d264ae7
4 files changed
+6
-6
No files matched your search
@@ -77,7 +77,7 @@ struct CoverageFormat1_3
|
||||
|
||||
bool intersects (const hb_set_t *glyphs) const
|
||||
{
|
||||
if (glyphArray.len > glyphs->get_population () * hb_bit_storage ((unsigned) glyphArray.len) / 2)
|
||||
if (glyphArray.len > glyphs->get_population () * hb_bit_storage ((unsigned) glyphArray.len))
|
||||
{
|
||||
for (auto g : *glyphs)
|
||||
if (get_coverage (g) != NOT_COVERED)
|
||||
|
||||
@@ -120,7 +120,7 @@ struct CoverageFormat2_4
|
||||
|
||||
bool intersects (const hb_set_t *glyphs) const
|
||||
{
|
||||
if (rangeRecord.len > glyphs->get_population () * hb_bit_storage ((unsigned) rangeRecord.len) / 2)
|
||||
if (rangeRecord.len > glyphs->get_population () * hb_bit_storage ((unsigned) rangeRecord.len))
|
||||
{
|
||||
for (auto g : *glyphs)
|
||||
if (get_coverage (g) != NOT_COVERED)
|
||||
|
||||
@@ -54,7 +54,7 @@ struct PairPosFormat1_3
|
||||
{
|
||||
auto &cov = this+coverage;
|
||||
|
||||
if (pairSet.len > glyphs->get_population () * hb_bit_storage ((unsigned) pairSet.len) / 4)
|
||||
if (pairSet.len > glyphs->get_population () * hb_bit_storage ((unsigned) pairSet.len))
|
||||
{
|
||||
for (hb_codepoint_t g : glyphs->iter())
|
||||
{
|
||||
|
||||
@@ -1850,7 +1850,7 @@ struct ClassDefFormat2_4
|
||||
hb_sorted_vector_t<hb_codepoint_pair_t> glyph_and_klass;
|
||||
hb_set_t orig_klasses;
|
||||
|
||||
if (glyph_set.get_population () * hb_bit_storage ((unsigned) rangeRecord.len) / 2
|
||||
if (glyph_set.get_population () * hb_bit_storage ((unsigned) rangeRecord.len)
|
||||
< get_population ())
|
||||
{
|
||||
for (hb_codepoint_t g : glyph_set)
|
||||
@@ -1931,7 +1931,7 @@ struct ClassDefFormat2_4
|
||||
|
||||
bool intersects (const hb_set_t *glyphs) const
|
||||
{
|
||||
if (rangeRecord.len > glyphs->get_population () * hb_bit_storage ((unsigned) rangeRecord.len) / 2)
|
||||
if (rangeRecord.len > glyphs->get_population () * hb_bit_storage ((unsigned) rangeRecord.len))
|
||||
{
|
||||
for (auto g : *glyphs)
|
||||
if (get_class (g))
|
||||
@@ -2000,7 +2000,7 @@ struct ClassDefFormat2_4
|
||||
}
|
||||
|
||||
unsigned count = rangeRecord.len;
|
||||
if (count > glyphs->get_population () * hb_bit_storage (count) * 8)
|
||||
if (count > glyphs->get_population () * hb_bit_storage (count))
|
||||
{
|
||||
for (auto g : *glyphs)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user