From dc33b4a1555c184b83a402dfa1856b213e6b4fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=9F=D0=BE?= =?UTF-8?q?=D0=B4=D1=82=D0=B5=D0=BB=D0=B5=D0=B6=D0=BD=D0=B8=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2?= Date: Sun, 10 Jul 2011 07:08:51 +0200 Subject: [PATCH] [psaux] Optimize previous commit. * src/psaux/t1decode.c (t1_decoder_parse_charstrings) : Move error check down to avoid testing twice for good cases. --- ChangeLog | 8 ++++++++ src/psaux/t1decode.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index c58d6bf6a..f2b8365a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-07-10 Алексей Подтележников + + [psaux] Optimize previous commit. + + * src/psaux/t1decode.c (t1_decoder_parse_charstrings) + : Move error check down to avoid testing twice for + good cases. + 2011-07-08 Werner Lemberg [psaux] Add better argument check for `callothersubr'. diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c index a60ec38af..55c81e337 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:"