From 0c65a232fa00a1eb09ca0e9d1d8d26747b27416e Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Thu, 23 Apr 2020 11:23:54 +0430 Subject: [PATCH] minor, add unlikely around lookup_limit_exceeded checks addresses https://github.com/harfbuzz/harfbuzz/pull/2294#issuecomment-618022488 --- src/hb-ot-layout-gsubgpos.hh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 1d1a38db0..cf07ff449 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh @@ -1400,7 +1400,7 @@ struct Rule void closure (hb_closure_context_t *c, ContextClosureLookupContext &lookup_context) const { - if (c->lookup_limit_exceeded ()) return; + if (unlikely (c->lookup_limit_exceeded ())) return; const UnsizedArrayOf &lookupRecord = StructAfter> (inputZ.as_array ((inputCount ? inputCount - 1 : 0))); @@ -1412,7 +1412,7 @@ struct Rule void closure_lookups (hb_closure_lookups_context_t *c) const { - if (c->lookup_limit_exceeded ()) return; + if (unlikely (c->lookup_limit_exceeded ())) return; const UnsizedArrayOf &lookupRecord = StructAfter> (inputZ.as_array (inputCount ? inputCount - 1 : 0)); @@ -1492,7 +1492,7 @@ struct RuleSet void closure (hb_closure_context_t *c, ContextClosureLookupContext &lookup_context) const { - if (c->lookup_limit_exceeded ()) return; + if (unlikely (c->lookup_limit_exceeded ())) return; return + hb_iter (rule) @@ -1503,7 +1503,7 @@ struct RuleSet void closure_lookups (hb_closure_lookups_context_t *c) const { - if (c->lookup_limit_exceeded ()) return; + if (unlikely (c->lookup_limit_exceeded ())) return; return + hb_iter (rule) @@ -2092,7 +2092,7 @@ struct ChainRule void closure (hb_closure_context_t *c, ChainContextClosureLookupContext &lookup_context) const { - if (c->lookup_limit_exceeded ()) return; + if (unlikely (c->lookup_limit_exceeded ())) return; const HeadlessArrayOf &input = StructAfter> (backtrack); const ArrayOf &lookahead = StructAfter> (input); @@ -2107,7 +2107,7 @@ struct ChainRule void closure_lookups (hb_closure_lookups_context_t *c) const { - if (c->lookup_limit_exceeded ()) return; + if (unlikely (c->lookup_limit_exceeded ())) return; const HeadlessArrayOf &input = StructAfter> (backtrack); const ArrayOf &lookahead = StructAfter> (input); @@ -2275,7 +2275,7 @@ struct ChainRuleSet } void closure (hb_closure_context_t *c, ChainContextClosureLookupContext &lookup_context) const { - if (c->lookup_limit_exceeded ()) return; + if (unlikely (c->lookup_limit_exceeded ())) return; return + hb_iter (rule) @@ -2286,7 +2286,7 @@ struct ChainRuleSet void closure_lookups (hb_closure_lookups_context_t *c) const { - if (c->lookup_limit_exceeded ()) return; + if (unlikely (c->lookup_limit_exceeded ())) return; return + hb_iter (rule)