[iter] More daggers
This commit is contained in:
parent
688069bbfb
commit
22ec4c3aa5
|
@ -706,10 +706,11 @@ static inline bool intersects_array (const hb_set_t *glyphs,
|
||||||
intersects_func_t intersects_func,
|
intersects_func_t intersects_func,
|
||||||
const void *intersects_data)
|
const void *intersects_data)
|
||||||
{
|
{
|
||||||
for (auto it = hb_iter (values, count); it; ++it)
|
return
|
||||||
if (likely (!intersects_func (glyphs, *it, intersects_data)))
|
+ hb_iter (values, count)
|
||||||
return false;
|
| hb_map ([&] (const HBUINT16 &_) -> bool { return intersects_func (glyphs, _, intersects_data); })
|
||||||
return true;
|
| hb_any
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -734,8 +735,10 @@ static inline void collect_array (hb_collect_glyphs_context_t *c HB_UNUSED,
|
||||||
collect_glyphs_func_t collect_func,
|
collect_glyphs_func_t collect_func,
|
||||||
const void *collect_data)
|
const void *collect_data)
|
||||||
{
|
{
|
||||||
for (auto it = hb_iter (values, count); it; ++it)
|
return
|
||||||
collect_func (glyphs, *it, collect_data);
|
+ hb_iter (values, count)
|
||||||
|
| hb_apply ([&] (const HBUINT16 &_) { collect_func (glyphs, _, collect_data); })
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1366,43 +1369,51 @@ struct RuleSet
|
||||||
bool intersects (const hb_set_t *glyphs,
|
bool intersects (const hb_set_t *glyphs,
|
||||||
ContextClosureLookupContext &lookup_context) const
|
ContextClosureLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
for (auto it = hb_iter (rule); it; ++it)
|
return
|
||||||
if ((this+*it).intersects (glyphs, lookup_context))
|
+ hb_iter (rule)
|
||||||
return true;
|
| hb_map ([&] (const OffsetTo<Rule> &_) -> bool { return (this+_).intersects (glyphs, lookup_context); })
|
||||||
return false;
|
| hb_any
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c,
|
void closure (hb_closure_context_t *c,
|
||||||
ContextClosureLookupContext &lookup_context) const
|
ContextClosureLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
for (auto it = hb_iter (rule); it; ++it)
|
return
|
||||||
(this+*it).closure (c, lookup_context);
|
+ hb_iter (rule)
|
||||||
|
| hb_apply ([&] (const OffsetTo<Rule> &_) { (this+_).closure (c, lookup_context); })
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
void collect_glyphs (hb_collect_glyphs_context_t *c,
|
void collect_glyphs (hb_collect_glyphs_context_t *c,
|
||||||
ContextCollectGlyphsLookupContext &lookup_context) const
|
ContextCollectGlyphsLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
for (auto it = hb_iter (rule); it; ++it)
|
return
|
||||||
(this+*it).collect_glyphs (c, lookup_context);
|
+ hb_iter (rule)
|
||||||
|
| hb_apply ([&] (const OffsetTo<Rule> &_) { (this+_).collect_glyphs (c, lookup_context); })
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool would_apply (hb_would_apply_context_t *c,
|
bool would_apply (hb_would_apply_context_t *c,
|
||||||
ContextApplyLookupContext &lookup_context) const
|
ContextApplyLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
for (auto it = hb_iter (rule); it; ++it)
|
return
|
||||||
if ((this+*it).would_apply (c, lookup_context))
|
+ hb_iter (rule)
|
||||||
return true;
|
| hb_map ([&] (const OffsetTo<Rule> &_) -> bool { return (this+_).would_apply (c, lookup_context); })
|
||||||
return false;
|
| hb_any
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool apply (hb_ot_apply_context_t *c,
|
bool apply (hb_ot_apply_context_t *c,
|
||||||
ContextApplyLookupContext &lookup_context) const
|
ContextApplyLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
TRACE_APPLY (this);
|
TRACE_APPLY (this);
|
||||||
for (auto it = hb_iter (rule); it; ++it)
|
return_trace (
|
||||||
if ((this+*it).apply (c, lookup_context))
|
+ hb_iter (rule)
|
||||||
return_trace (true);
|
| hb_map ([&] (const OffsetTo<Rule> &_) -> bool { return (this+_).apply (c, lookup_context); })
|
||||||
return_trace (false);
|
| hb_any
|
||||||
|
)
|
||||||
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool sanitize (hb_sanitize_context_t *c) const
|
bool sanitize (hb_sanitize_context_t *c) const
|
||||||
|
|
Loading…
Reference in New Issue