From 530ddbbc320bd24b4902ee6d49bf80242a591794 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 7 May 2019 11:05:51 -0700 Subject: [PATCH] [serialize] Use range-based loop --- src/hb-serialize.hh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/hb-serialize.hh b/src/hb-serialize.hh index afaa4c4f9..1a6ed2116 100644 --- a/src/hb-serialize.hh +++ b/src/hb-serialize.hh @@ -287,26 +287,23 @@ struct hb_serialize_context_t { assert (!current); - for (auto obj_it = ++hb_iter (packed); obj_it; ++obj_it) + for (const object_t *parent : ++hb_iter (packed)) { - const object_t &parent = **obj_it; - - for (auto link_it = parent.links.iter (); link_it; ++link_it) + for (const object_t::link_t &link : parent->links) { - const object_t::link_t &link = *link_it; const object_t &child = *packed[link.objidx]; - //assert (link.bias <= parent.tail - parent.head); - unsigned offset = (child.head - parent.head) - link.bias; + //assert (link.bias <= parent->tail - parent->head); + unsigned offset = (child.head - parent->head) - link.bias; if (link.is_wide) { - auto &off = * ((BEInt *) (parent.head + link.position)); + auto &off = * ((BEInt *) (parent->head + link.position)); assert (0 == off); check_assign (off, offset); } else { - auto &off = * ((BEInt *) (parent.head + link.position)); + auto &off = * ((BEInt *) (parent->head + link.position)); assert (0 == off); check_assign (off, offset); }