[set] Use hb_fill()

This commit is contained in:
Behdad Esfahbod 2021-01-21 12:18:48 -07:00
parent 5fce8898e0
commit ca0b7afee9
2 changed files with 6 additions and 7 deletions

View File

@ -1357,7 +1357,7 @@ struct CoverageFormat2
bool intersects (const hb_set_t *glyphs) const
{
/* TODO Speed up, using hb_set_next() and bsearch()? */
/* TODO Rewrite as dagger. */
/* TODO(iter) Rewrite as dagger. */
unsigned count = rangeRecord.len;
const RangeRecord *arr = rangeRecord.arrayZ;
for (unsigned i = 0; i < count; i++)
@ -1367,7 +1367,7 @@ struct CoverageFormat2
}
bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const
{
/* TODO Rewrite as dagger. */
/* TODO(iter) Rewrite as dagger. */
unsigned count = rangeRecord.len;
const RangeRecord *arr = rangeRecord.arrayZ;
for (unsigned i = 0; i < count; i++) {
@ -1820,7 +1820,7 @@ struct ClassDefFormat1
/* Fall through. */
}
/* TODO Speed up, using set overlap first? */
/* TODO Rewrite as dagger. */
/* TODO(iter) Rewrite as dagger. */
HBUINT16 k; /* TODO(constexpr) use constructor to initialize. */
k = klass;
const HBUINT16 *arr = classValue.arrayZ;
@ -1994,7 +1994,7 @@ struct ClassDefFormat2
/* Fall through. */
}
/* TODO Speed up, using set overlap first? */
/* TODO Rewrite as dagger. */
/* TODO(iter) Rewrite as dagger. */
HBUINT16 k; /* TODO(constexpr) use constructor to initialize. */
k = klass;
const RangeRecord *arr = rangeRecord.arrayZ;

View File

@ -540,9 +540,8 @@ struct hb_set_t
assert(workspace.length == pages.length);
hb_vector_t<unsigned>& old_index_to_page_map_index = workspace;
for (unsigned i = 0; i < old_index_to_page_map_index.length; i++)
old_index_to_page_map_index[i] = 0xFFFFFFFF;
hb_fill (old_index_to_page_map_index.writer(), 0xFFFFFFFF);
/* TODO(iter) Rewrite as dagger? */
for (unsigned i = 0; i < length; i++)
old_index_to_page_map_index[page_map[i].index] = i;