minor, replace single hb_apply daggers with foreach

This commit is contained in:
Ebrahim Byagowi 2020-06-21 09:49:48 +04:30
parent 8bca9a420e
commit e541fb474c
3 changed files with 27 additions and 34 deletions

View File

@ -117,9 +117,8 @@ struct hb_hashmap_t
successful = false;
return false;
}
+ hb_iter (new_items, new_size)
| hb_apply (&item_t::clear)
;
for (auto &_ : hb_iter (new_items, new_size))
_.clear ();
unsigned int old_size = mask + 1;
item_t *old_items = items;
@ -175,9 +174,8 @@ struct hb_hashmap_t
if (unlikely (hb_object_is_immutable (this)))
return;
if (items)
+ hb_iter (items, mask + 1)
| hb_apply (&item_t::clear)
;
for (auto &_ : hb_iter (items, mask + 1))
_.clear ();
population = occupancy = 0;
}

View File

@ -101,8 +101,7 @@ struct hmtxvmtx
unsigned num_advances)
{
unsigned idx = 0;
+ it
| hb_apply ([c, &idx, num_advances] (const hb_item_type<Iterator>& _)
for (auto _ : it)
{
if (idx < num_advances)
{
@ -118,8 +117,7 @@ struct hmtxvmtx
*sb = _.second;
}
idx++;
})
;
}
}
bool subset (hb_subset_context_t *c) const

View File

@ -515,10 +515,9 @@ struct MathGlyphAssembly
if (parts_count)
{
int64_t mult = font->dir_mult (direction);
+ hb_zip (partRecords.sub_array (start_offset, parts_count), hb_array (parts, *parts_count))
| hb_apply ([&] (hb_pair_t<const MathGlyphPartRecord &, hb_ot_math_glyph_part_t &> _)
{ _.first.extract (_.second, mult, font); })
;
for (auto _ : hb_zip (partRecords.sub_array (start_offset, parts_count),
hb_array (parts, *parts_count)))
_.first.extract (_.second, mult, font);
}
if (italics_correction)
@ -563,11 +562,9 @@ struct MathGlyphConstruction
if (variants_count)
{
int64_t mult = font->dir_mult (direction);
+ hb_zip (mathGlyphVariantRecord.sub_array (start_offset, variants_count),
hb_array (variants, *variants_count))
| hb_apply ([&] (hb_pair_t<const MathGlyphVariantRecord &, hb_ot_math_glyph_variant_t &> _)
{ _.second = {_.first.variantGlyph, font->em_mult (_.first.advanceMeasurement, mult)}; })
;
for (auto _ : hb_zip (mathGlyphVariantRecord.sub_array (start_offset, variants_count),
hb_array (variants, *variants_count)))
_.second = {_.first.variantGlyph, font->em_mult (_.first.advanceMeasurement, mult)};
}
return mathGlyphVariantRecord.len;
}