summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Lemberg <wl@gnu.org>2022-02-19 05:26:53 +0100
committerWerner Lemberg <wl@gnu.org>2022-02-19 07:20:24 +0100
commit5b26e92a0f01fa21b618aceb763e013614fb7054 (patch)
tree4ea86467a350b0bfb8c9b986de67c5e3b9bc92c4
parent20ec99be7ecfd1a07e1ff7a7ef3e510203ea33bd (diff)
downloadfreetype2-5b26e92a0f01fa21b618aceb763e013614fb7054.tar.gz
src/sfnt/ttkern.c (tt_face_load_kern): Micro-optimize.
A kerning table can be handled by binary search if it has equal entries. Fixes #1132.
-rw-r--r--src/sfnt/ttkern.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sfnt/ttkern.c b/src/sfnt/ttkern.c
index d9f6a0e90..5634267de 100644
--- a/src/sfnt/ttkern.c
+++ b/src/sfnt/ttkern.c
@@ -94,7 +94,7 @@
p_next = p;
- p += 2; /* skip version */
+ p += 2; /* skip version */
length = FT_NEXT_USHORT( p );
coverage = FT_NEXT_USHORT( p );
@@ -144,7 +144,7 @@
cur_pair = FT_NEXT_ULONG( p );
- if ( cur_pair <= old_pair )
+ if ( cur_pair < old_pair )
break;
p += 2;
@@ -187,8 +187,9 @@
FT_UInt left_glyph,
FT_UInt right_glyph )
{
- FT_Int result = 0;
- FT_UInt count, mask;
+ FT_Int result = 0;
+ FT_UInt count, mask;
+
FT_Byte* p = face->kern_table;
FT_Byte* p_limit = p + face->kern_table_size;