shithub: freetype+ttf2subf

Download patch

ref: d4cbbf35d44c96641be5b614181d058c51623500
parent: ad866e2c9aa54afc8d2a702ae078b43055d5bd4b
author: Werner Lemberg <[email protected]>
date: Tue Jul 3 07:01:53 EDT 2012

[autofit] Minor speed-up.

* src/autofit/afangles (af_sort_pos, af_sort_widths): Don't swap
elements if they are equal.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-07-03  Werner Lemberg  <[email protected]>
+
+	[autofit] Minor speed-up.
+
+	* src/autofit/afangles (af_sort_pos, af_sort_widths): Don't swap
+	elements if they are equal.
+
 2012-06-30  Gilles Espinasse  <[email protected]>
 
 	Fix `checking if gcc static flag -static works' test.
--- a/src/autofit/afangles.c
+++ b/src/autofit/afangles.c
@@ -5,7 +5,7 @@
 /*    Routines used to compute vector angles with limited accuracy         */
 /*    and very high speed.  It also contains sorting routines (body).      */
 /*                                                                         */
-/*  Copyright 2003-2006, 2011 by                                           */
+/*  Copyright 2003-2006, 2011-2012 by                                      */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -255,7 +255,7 @@
     {
       for ( j = i; j > 0; j-- )
       {
-        if ( table[j] > table[j - 1] )
+        if ( table[j] >= table[j - 1] )
           break;
 
         swap         = table[j];
@@ -278,7 +278,7 @@
     {
       for ( j = i; j > 0; j-- )
       {
-        if ( table[j].org > table[j - 1].org )
+        if ( table[j].org >= table[j - 1].org )
           break;
 
         swap         = table[j];