[minor] Add unlikely() when checking for error
diff --git a/src/hb-face.cc b/src/hb-face.cc index a15687c..900014f 100644 --- a/src/hb-face.cc +++ b/src/hb-face.cc
@@ -756,7 +756,7 @@ hb_face_builder_data_t *data = (hb_face_builder_data_t *) face->user_data; hb_face_builder_data_t::table_entry_t *entry = data->tables.push (); - if (data->tables.in_error()) + if (unlikely (data->tables.in_error())) return false; entry->tag = tag;
diff --git a/src/hb-ot-glyf-table.hh b/src/hb-ot-glyf-table.hh index 5470bd9..ec77c2b 100644 --- a/src/hb-ot-glyf-table.hh +++ b/src/hb-ot-glyf-table.hh
@@ -186,7 +186,7 @@ | hb_map (&SubsetGlyph::padded_size) ; - if (c->serializer->in_error ()) return_trace (false); + if (unlikely (c->serializer->in_error ())) return_trace (false); return_trace (c->serializer->check_success (_add_loca_and_head (c->plan, padded_offsets))); }
diff --git a/src/hb-ot-layout-gsubgpos.hh b/src/hb-ot-layout-gsubgpos.hh index 101d03e..82ef694 100644 --- a/src/hb-ot-layout-gsubgpos.hh +++ b/src/hb-ot-layout-gsubgpos.hh
@@ -89,7 +89,7 @@ bool is_lookup_done (unsigned int lookup_index) { - if (done_lookups->in_error ()) + if (unlikely (done_lookups->in_error ())) return true; /* Have we visited this lookup with the current set of glyphs? */ @@ -162,10 +162,10 @@ bool is_lookup_visited (unsigned lookup_index) { - if (lookup_count++ > HB_MAX_LOOKUP_INDICES) + if (unlikely (lookup_count++ > HB_MAX_LOOKUP_INDICES)) return true; - if (visited_lookups->in_error ()) + if (unlikely (visited_lookups->in_error ())) return true; return visited_lookups->has (lookup_index); @@ -3397,7 +3397,7 @@ hb_set_t alternate_feature_indices; if (version.to_int () >= 0x00010001u) (this+featureVars).closure_features (lookup_indices, &alternate_feature_indices); - if (alternate_feature_indices.in_error()) { + if (unlikely (alternate_feature_indices.in_error())) { feature_indices->successful = false; return; }