From e0717d4f48377faa0c5a0fdabfe44b632e6d78dd Mon Sep 17 00:00:00 2001 From: Werner Lemberg Date: Sat, 27 Feb 2010 08:10:11 +0100 Subject: [PATCH] Simplify code. Suggested by Behdad. * src/base/ftobjs.c (FT_Get_First_Char): Don't use a loop since we call FT_Get_Next_Char anyway if necessary. --- ChangeLog | 8 ++++++++ src/base/ftobjs.c | 4 +--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ec3a0d7a3..c0aaa70c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-02-27 Werner Lemberg + + Simplify code. + Suggested by Behdad. + + * src/base/ftobjs.c (FT_Get_First_Char): Don't use a loop since we + call FT_Get_Next_Char anyway if necessary. + 2010-02-26 Behdad Esfahbod Improve handling of invalid glyph indices in char->index functions. diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c index 54c7fb30c..d5ff32fad 100644 --- a/src/base/ftobjs.c +++ b/src/base/ftobjs.c @@ -3113,9 +3113,7 @@ { gindex = FT_Get_Char_Index( face, 0 ); if ( gindex == 0 || gindex >= (FT_UInt)face->num_glyphs ) - do { - result = FT_Get_Next_Char( face, 0, &gindex ); - } while ( gindex >= (FT_UInt)face->num_glyphs ); + result = FT_Get_Next_Char( face, 0, &gindex ); } if ( agindex )