summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner <david@freetype.org>2007-01-05 13:15:29 +0000
committerDavid Turner <david@freetype.org>2007-01-05 13:15:29 +0000
commita3a3c5d711268da41c6862b50984605b60feb2aa (patch)
tree2c5decf085b056230abb927023eed37ba27b7367
parent5dbdb6c3c4f681186716234c3738cd3a0d2412a1 (diff)
small optimization in the CMAP 4 validator
-rw-r--r--ChangeLog2
-rw-r--r--src/sfnt/ttcmap.c17
2 files changed, 11 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 112aa4e5..c99c8232 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
2007-01-04 David Turner <david@freetype.org>
+ * src/sfnt/ttcmap.c: slight optimization in the CMAP 4 validator
+
* src/cff/cffload.c, src/cff/cffload.h, src/cff/cffgload.c,
src/cff/cfftypes.h: formatting + do not load the CFF index
offsets into memory, since this wastes a *lot* of heap memory
diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c
index 7795105a..424716bf 100644
--- a/src/sfnt/ttcmap.c
+++ b/src/sfnt/ttcmap.c
@@ -862,18 +862,19 @@
FT_UInt start, end, offset, n;
FT_UInt last_start = 0, last_end = 0;
FT_Int delta;
+ FT_Byte* p_start = starts;
+ FT_Byte* p_end = ends;
+ FT_Byte* p_delta = deltas;
+ FT_Byte* p_offset = offsets;
for ( n = 0; n < num_segs; n++ )
{
- p = starts + n * 2;
- start = TT_PEEK_USHORT( p );
- p = ends + n * 2;
- end = TT_PEEK_USHORT( p );
- p = deltas + n * 2;
- delta = TT_PEEK_SHORT( p );
- p = offsets + n * 2;
- offset = TT_PEEK_USHORT( p );
+ p = p_offset;
+ start = TT_NEXT_USHORT( p_start );
+ end = TT_NEXT_USHORT( p_end );
+ delta = TT_NEXT_SHORT( p_delta );
+ offset = TT_NEXT_USHORT( p_offset );
if ( start > end )
FT_INVALID_DATA;