mirror of
https://github.com/harfbuzz/harfbuzz.git
synced 2025-04-12 16:23:01 +00:00
[aat] Remove a lambda
This lambda was added to "simplify" the logic. But has a lot of overhead.
This commit is contained in:
parent
d9a25bc4ee
commit
556eb02977
1 changed files with 9 additions and 11 deletions
|
@ -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…
Add table
Reference in a new issue