From c42848e6d9d2a2aa9adcc99fa4e817f4e4e9f656 Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sun, 26 Feb 2012 19:44:04 +0100 Subject: [PATCH] [type42] Minor code optimization. * src/type42/t42parse.c (t42_parse_sfnts): Use bitmask instead of modulo operator. --- ChangeLog | 7 +++++++ src/type42/t42parse.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c489e94d..f71cab3ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2012-02-26 Alexei Podtelezhnikov + + [type42] Minor code optimization. + + * src/type42/t42parse.c (t42_parse_sfnts): Use bitmask instead of + modulo operator. + 2012-02-26 Werner Lemberg * docs/CHANGES: Updated. diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c index f2408cdfe..1888c3c9b 100644 --- a/src/type42/t42parse.c +++ b/src/type42/t42parse.c @@ -608,8 +608,8 @@ } /* A string can have a trailing zero byte for padding. Ignore it. */ - if ( string_size && - string_buf[string_size - 1] == 0 && ( string_size % 2 == 1 ) ) + if ( string_size && + string_buf[string_size - 1] == 0 && ( string_size & 1 ) ) string_size--; if ( !string_size )