From 977c8a8e5c811995f47b0eb721199d0dc3689e48 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Tue, 9 Oct 2018 00:22:08 -0400 Subject: [PATCH] [kern] Minor --- src/hb-ot-kern-table.hh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/hb-ot-kern-table.hh b/src/hb-ot-kern-table.hh index 0af188e7c..0ab9322f5 100644 --- a/src/hb-ot-kern-table.hh +++ b/src/hb-ot-kern-table.hh @@ -68,11 +68,17 @@ struct hb_kern_machine_t unsigned int i = idx; unsigned int j = skippy_iter.idx; + hb_position_t kern1, kern2; + hb_position_t kern = driver.get_kerning (info[i].codepoint, info[j].codepoint); - hb_position_t kern1 = kern >> 1; - hb_position_t kern2 = kern - kern1; + + if (likely (!kern)) + goto skip; + + kern1 = kern >> 1; + kern2 = kern - kern1; if (horizontal) { @@ -89,6 +95,7 @@ struct hb_kern_machine_t buffer->unsafe_to_break (i, j + 1); + skip: idx = skippy_iter.idx; } }