Commit c42848e6d9d2a2aa9adcc99fa4e817f4e4e9f656

Werner Lemberg 2012-02-26T19:44:04

[type42] Minor code optimization. * src/type42/t42parse.c (t42_parse_sfnts): Use bitmask instead of modulo operator.

diff --git a/ChangeLog b/ChangeLog
index 7c489e9..f71cab3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-02-26  Alexei Podtelezhnikov  <apodtele@gmail.com>
+
+	[type42] Minor code optimization.
+
+	* src/type42/t42parse.c (t42_parse_sfnts): Use bitmask instead of
+	modulo operator.
+
 2012-02-26  Werner Lemberg  <wl@gnu.org>
 
 	* docs/CHANGES: Updated.
diff --git a/src/type42/t42parse.c b/src/type42/t42parse.c
index f2408cd..1888c3c 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 )