[aat] Remove a lambda

This lambda was added to "simplify" the logic. But has a lot of overhead.
pull/5031/head
Behdad Esfahbod 2 weeks ago
parent d9a25bc4ee
commit 556eb02977
  1. 20
      src/hb-aat-layout-common.hh

@ -1032,26 +1032,24 @@ struct StateTableDriver
&& (entry.flags & context_t::DontAdvance) == (wouldbe_entry.flags & context_t::DontAdvance);
};
const auto is_safe_to_break = [&]()
{
bool is_safe_to_break =
(
/* 1. */
if (c->is_actionable (buffer, this, entry))
return false;
!c->is_actionable (buffer, this, entry) &&
/* 2. */
// This one is meh, I know...
const auto ok =
(
state == StateTableT::STATE_START_OF_TEXT
|| ((entry.flags & context_t::DontAdvance) && next_state == StateTableT::STATE_START_OF_TEXT)
|| is_safe_to_break_extra();
if (!ok)
return false;
|| is_safe_to_break_extra()
) &&
/* 3. */
return !c->is_actionable (buffer, this, machine.get_entry (state, CLASS_END_OF_TEXT));
};
!c->is_actionable (buffer, this, machine.get_entry (state, CLASS_END_OF_TEXT))
);
if (!is_safe_to_break () && buffer->backtrack_len () && buffer->idx < buffer->len)
if (!is_safe_to_break && buffer->backtrack_len () && buffer->idx < buffer->len)
buffer->unsafe_to_break_from_outbuffer (buffer->backtrack_len () - 1, buffer->idx + 1);
c->transition (buffer, this, entry);

Loading…
Cancel
Save