Commit b7fc0c74616dc6abe74616dae1b28503c82d00fc

Werner Lemberg 2011-02-26T18:36:21

[autofit] Slight simplifications. * src/autofit/aflatin.c (af_latin_hints_link_segments): Remove test which always returns false. (af_latin_hints_compute_blue_edges): Remove redundant assignment.

diff --git a/ChangeLog b/ChangeLog
index b4ca1fa..503b764 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-02-26  Werner Lemberg  <wl@gnu.org>
+
+	[autofit] Slight simplifications.
+
+	* src/autofit/aflatin.c (af_latin_hints_link_segments): Remove
+	test which always returns false.
+	(af_latin_hints_compute_blue_edges): Remove redundant assignment.
+
 2011-02-24  Werner Lemberg  <wl@gnu.org>
 
 	* docs/PROBLEMS: Mention rendering differences on different
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index c83ea2e..99e8827 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -900,47 +900,44 @@
         continue;
 
       for ( seg2 = segments; seg2 < segment_limit; seg2++ )
-        if ( seg1->dir + seg2->dir == 0 && seg2->pos > seg1->pos )
-        {
-          FT_Pos  pos1 = seg1->pos;
-          FT_Pos  pos2 = seg2->pos;
-          FT_Pos  dist = pos2 - pos1;
+      {
+        FT_Pos  pos1 = seg1->pos;
+        FT_Pos  pos2 = seg2->pos;
 
 
-          if ( dist < 0 )
-            dist = -dist;
+        if ( seg1->dir + seg2->dir == 0 && pos2 > pos1 )
+        {
+          FT_Pos  dist = pos2 - pos1;
+          FT_Pos  min  = seg1->min_coord;
+          FT_Pos  max  = seg1->max_coord;
+          FT_Pos  len, score;
 
-          {
-            FT_Pos  min = seg1->min_coord;
-            FT_Pos  max = seg1->max_coord;
-            FT_Pos  len, score;
 
+          if ( min < seg2->min_coord )
+            min = seg2->min_coord;
 
-            if ( min < seg2->min_coord )
-              min = seg2->min_coord;
+          if ( max > seg2->max_coord )
+            max = seg2->max_coord;
 
-            if ( max > seg2->max_coord )
-              max = seg2->max_coord;
+          len = max - min;
+          if ( len >= len_threshold )
+          {
+            score = dist + len_score / len;
 
-            len = max - min;
-            if ( len >= len_threshold )
+            if ( score < seg1->score )
             {
-              score = dist + len_score / len;
-
-              if ( score < seg1->score )
-              {
-                seg1->score = score;
-                seg1->link  = seg2;
-              }
+              seg1->score = score;
+              seg1->link  = seg2;
+            }
 
-              if ( score < seg2->score )
-              {
-                seg2->score = score;
-                seg2->link  = seg1;
-              }
+            if ( score < seg2->score )
+            {
+              seg2->score = score;
+              seg2->link  = seg1;
             }
           }
         }
+      }
     }
 
     /* now, compute the `serif' segments */
@@ -1339,7 +1336,6 @@
 
             if ( is_top_blue ^ is_under_ref )
             {
-              blue = latin->blues + bb;
               dist = edge->fpos - blue->shoot.org;
               if ( dist < 0 )
                 dist = -dist;