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

View File

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

View File

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