[cff] Simplify add_op()

This commit is contained in:
Behdad Esfahbod 2023-01-02 12:26:43 -07:00
parent 27531d853e
commit d5e1748f31
1 changed files with 1 additions and 11 deletions

View File

@ -525,17 +525,7 @@ struct parsed_values_t
values.alloc (n, true); values.alloc (n, true);
} }
void add_op (op_code_t op, const byte_str_ref_t& str_ref = byte_str_ref_t ()) void add_op (op_code_t op, const byte_str_ref_t& str_ref = byte_str_ref_t (), const VAL &v = VAL ())
{
VAL *val = values.push ();
val->op = op;
auto arr = str_ref.sub_array (opStart, str_ref.get_offset () - opStart);
val->ptr = arr.arrayZ;
val->length = arr.length;
opStart = str_ref.get_offset ();
}
void add_op (op_code_t op, const byte_str_ref_t& str_ref, const VAL &v)
{ {
VAL *val = values.push (v); VAL *val = values.push (v);
val->op = op; val->op = op;