[cff] Optimize byte_str_ref_t inc()
Shows a couple percent speedup.
This commit is contained in:
parent
3ff75411bd
commit
a81ec9b2b6
|
@ -315,10 +315,8 @@ struct byte_str_ref_t
|
||||||
{ return get_offset () + count <= str.length; }
|
{ return get_offset () + count <= str.length; }
|
||||||
void inc (unsigned int count=1)
|
void inc (unsigned int count=1)
|
||||||
{
|
{
|
||||||
if (get_offset () + count <= str.length)
|
/* Automatically puts us in error if count is out-of-range. */
|
||||||
set_offset (get_offset () + count);
|
set_offset (get_offset () + count);
|
||||||
else
|
|
||||||
set_error ();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* We (ab)use ubytes backwards_length as a cursor (called offset),
|
/* We (ab)use ubytes backwards_length as a cursor (called offset),
|
||||||
|
|
Loading…
Reference in New Issue