Commit e0717d4f48377faa0c5a0fdabfe44b632e6d78dd

Werner Lemberg 2010-02-27T08:10:11

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.

diff --git a/ChangeLog b/ChangeLog
index ec3a0d7..c0aaa70 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2010-02-27  Werner Lemberg  <wl@gnu.org>
+
+	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  <behdad@behdad.org>
 
 	Improve handling of invalid glyph indices in char->index functions.
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 54c7fb3..d5ff32f 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 )