[subset-cff] Write loop more idiomatic

This commit is contained in:
Behdad Esfahbod 2022-11-27 13:23:13 -07:00
parent 3ff502d3ae
commit 3860326688
2 changed files with 12 additions and 11 deletions

View File

@ -31,7 +31,7 @@
#include "hb.hh" #include "hb.hh"
#line 35 "hb-number-parser.hh" #line 32 "hb-number-parser.hh"
static const unsigned char _double_parser_trans_keys[] = { static const unsigned char _double_parser_trans_keys[] = {
0u, 0u, 43u, 57u, 46u, 57u, 48u, 57u, 43u, 57u, 48u, 57u, 48u, 101u, 48u, 57u, 0u, 0u, 43u, 57u, 46u, 57u, 48u, 57u, 43u, 57u, 48u, 57u, 48u, 101u, 48u, 57u,
46u, 101u, 0 46u, 101u, 0
@ -135,12 +135,12 @@ strtod_rl (const char *p, const char **end_ptr /* IN/OUT */)
int cs; int cs;
#line 139 "hb-number-parser.hh" #line 132 "hb-number-parser.hh"
{ {
cs = double_parser_start; cs = double_parser_start;
} }
#line 144 "hb-number-parser.hh" #line 135 "hb-number-parser.hh"
{ {
int _slen; int _slen;
int _trans; int _trans;
@ -198,7 +198,7 @@ _resume:
exp_overflow = true; exp_overflow = true;
} }
break; break;
#line 202 "hb-number-parser.hh" #line 187 "hb-number-parser.hh"
} }
_again: _again:

View File

@ -963,21 +963,22 @@ struct subr_subsetter_t
if (!str.has_calls ()) if (!str.has_calls ())
return; return;
auto *value = str.values.arrayZ; auto *values = str.values.arrayZ;
auto *end = value + str.values.length; unsigned count = str.values.length;
for (; value < end; value++) for (unsigned i = 0; i < count; i++)
{ {
if (!value->for_drop ()) auto &value = values[i];
if (!value.for_drop ())
{ {
switch (value->op) switch (value.op)
{ {
case OpCode_callsubr: case OpCode_callsubr:
collect_subr_refs_in_subr (value->subr_num, *param.parsed_local_subrs, collect_subr_refs_in_subr (value.subr_num, *param.parsed_local_subrs,
param.local_closure, param); param.local_closure, param);
break; break;
case OpCode_callgsubr: case OpCode_callgsubr:
collect_subr_refs_in_subr (value->subr_num, *param.parsed_global_subrs, collect_subr_refs_in_subr (value.subr_num, *param.parsed_global_subrs,
param.global_closure, param); param.global_closure, param);
break; break;