Commit dc33b4a1555c184b83a402dfa1856b213e6b4fbd

Алексей Подтележников 2011-07-10T07:08:51

[psaux] Optimize previous commit. * src/psaux/t1decode.c (t1_decoder_parse_charstrings) <op_callothersubr>: Move error check down to avoid testing twice for good cases.

diff --git a/ChangeLog b/ChangeLog
index c58d6bf..f2b8365 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-07-10  Алексей Подтележников  <apodtele@gmail.com>
+
+	[psaux] Optimize previous commit.
+
+	* src/psaux/t1decode.c (t1_decoder_parse_charstrings)
+	<op_callothersubr>: Move error check down to avoid testing twice for
+	good cases.
+
 2011-07-08  Werner Lemberg  <wl@gnu.org>
 
 	[psaux] Add better argument check for `callothersubr'.
diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c
index a60ec38..55c81e3 100644
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -686,9 +686,6 @@
         subr_no = (FT_Int)( top[1] >> 16 );
         arg_cnt = (FT_Int)( top[0] >> 16 );
 
-        if ( arg_cnt < 0 || subr_no < 0 )
-          goto Unexpected_OtherSubr;
-
         /***********************************************************/
         /*                                                         */
         /* remove all operands to callothersubr from the stack     */
@@ -1011,11 +1008,14 @@
           break;
 
         default:
-          FT_ERROR(( "t1_decoder_parse_charstrings:"
-                     " unknown othersubr [%d %d], wish me luck\n",
-                     arg_cnt, subr_no ));
-          unknown_othersubr_result_cnt = arg_cnt;
-          break;
+          if ( arg_cnt >= 0 && subr_no > 0 )
+          {
+            FT_ERROR(( "t1_decoder_parse_charstrings:"
+                       " unknown othersubr [%d %d], wish me luck\n",
+                       arg_cnt, subr_no ));
+            unknown_othersubr_result_cnt = arg_cnt;
+            break;
+          }
 
         Unexpected_OtherSubr:
           FT_ERROR(( "t1_decoder_parse_charstrings:"