From cbc0646a6cfc0f6a04804d6888636f12130cd51b Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Tue, 24 Sep 2019 12:08:12 +0330 Subject: [PATCH] Minor, normalize for each calls --- src/hb-ot-glyf-table.hh | 5 +---- src/hb-ot-layout-gpos-table.hh | 10 +++++----- src/hb-ot-name-table.hh | 3 +-- src/hb-ot-vorg-table.hh | 3 +-- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh index bbb8a7946..9a791bbf0 100644 --- a/src/hb-ot-glyf-table.hh +++ b/src/hb-ot-glyf-table.hh @@ -143,10 +143,7 @@ struct glyf const hb_subset_plan_t *plan) { TRACE_SERIALIZE (this); - - for (const SubsetGlyph& _ : it) - _.serialize (c, plan); - + for (const auto &_ : it) _.serialize (c, plan); return_trace (true); } diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index d73ee6485..2f1a1b28f 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -510,7 +510,7 @@ struct SinglePosFormat1 if (unlikely (!c->extend_min (*this))) return; if (unlikely (!c->check_assign (valueFormat, valFormat))) return; - for (const Value& _ : hb_second (*it)) + for (const auto &_ : hb_second (*it)) c->copy (_); auto glyphs = @@ -598,8 +598,8 @@ struct SinglePosFormat2 if (unlikely (!c->check_assign (valueFormat, valFormat))) return; if (unlikely (!c->check_assign (valueCount, it.len ()))) return; - for (auto iter : it) - for (const Value& _ : iter.second) + for (const auto &&iter : it) + for (const auto &_ : iter.second) c->copy (_); auto glyphs = @@ -665,8 +665,8 @@ struct SinglePos { hb_array_t first_val_iter = hb_second (*glyph_val_iter_pairs); - for (auto iter : glyph_val_iter_pairs) - for (const hb_pair_t _ : hb_zip (iter.second, first_val_iter)) + for (const auto &&iter : glyph_val_iter_pairs) + for (const auto &&_ : hb_zip (iter.second, first_val_iter)) if (_.first != _.second) return 2; diff --git a/src/hb-ot-name-table.hh b/src/hb-ot-name-table.hh index 33f5eb37b..84be04c8b 100644 --- a/src/hb-ot-name-table.hh +++ b/src/hb-ot-name-table.hh @@ -191,8 +191,7 @@ struct name const void *dst_string_pool = &(this + this->stringOffset); - for (const NameRecord& _ : it) - c->copy (_, src_string_pool, dst_string_pool); + for (const auto &_ : it) c->copy (_, src_string_pool, dst_string_pool); if (unlikely (c->ran_out_of_room)) return_trace (false); diff --git a/src/hb-ot-vorg-table.hh b/src/hb-ot-vorg-table.hh index fea3a9acf..ddd3530a5 100644 --- a/src/hb-ot-vorg-table.hh +++ b/src/hb-ot-vorg-table.hh @@ -84,8 +84,7 @@ struct VORG this->defaultVertOriginY = defaultVertOriginY; this->vertYOrigins.len = it.len (); - for (const VertOriginMetric _ : it) - c->copy (_); + for (const auto &&_ : it) c->copy (_); } bool subset (hb_subset_context_t *c) const