From 0aef425e25e2c58445157057f17ef18f695c5240 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 30 Jul 2012 00:55:15 -0400 Subject: [PATCH] [GSUB] Minor --- src/hb-ot-layout-gpos-table.hh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/hb-ot-layout-gpos-table.hh b/src/hb-ot-layout-gpos-table.hh index 83252c1f1..5945b0fba 100644 --- a/src/hb-ot-layout-gpos-table.hh +++ b/src/hb-ot-layout-gpos-table.hh @@ -1147,19 +1147,16 @@ struct MarkLigPosFormat1 unsigned int comp_count = lig_attach.rows; if (unlikely (!comp_count)) return TRACE_RETURN (false); - unsigned int comp_index; /* We must now check whether the ligature ID of the current mark glyph * is identical to the ligature ID of the found ligature. If yes, we * can directly use the component index. If not, we attach the mark * glyph to the last component of the ligature. */ - if (get_lig_id (c->buffer->info[j]) && - get_lig_id (c->buffer->info[j]) == get_lig_id (c->buffer->cur()) && - get_lig_comp (c->buffer->cur()) > 0) - { - comp_index = get_lig_comp (c->buffer->cur()) - 1; - if (comp_index >= comp_count) - comp_index = comp_count - 1; - } + unsigned int comp_index; + unsigned int lig_id = get_lig_id (c->buffer->info[j]); + unsigned int mark_id = get_lig_id (c->buffer->cur()); + unsigned int mark_comp = get_lig_comp (c->buffer->cur()); + if (lig_id && lig_id == mark_id && mark_comp > 0) + comp_index = MIN (comp_count, get_lig_comp (c->buffer->cur())) - 1; else comp_index = comp_count - 1;