Aric Stewart : usp10: pwLogClust is ordered so its max will be on one end.

Alexandre Julliard julliard at winehq.org
Mon Jan 30 14:05:57 CST 2012


Module: wine
Branch: master
Commit: 2ab625bf2f0a17134d30ea42e4b66314713b95fb
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2ab625bf2f0a17134d30ea42e4b66314713b95fb

Author: Aric Stewart <aric at codeweavers.com>
Date:   Mon Jan 30 07:30:05 2012 -0600

usp10: pwLogClust is ordered so its max will be on one end.

---

 dlls/usp10/usp10.c |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index 3c1887a..ef8a7ac 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -2309,16 +2309,14 @@ static inline int get_cluster_size(const WORD *pwLogClust, int cChars, int item,
 static inline int get_glyph_cluster_advance(const int* piAdvance, const SCRIPT_VISATTR *pva, const WORD *pwLogClust, int cGlyphs, int cChars, int glyph, int direction)
 {
     int advance;
-    int log_clust_max = 0;
-    int i;
+    int log_clust_max;
 
     advance = piAdvance[glyph];
 
-    for (i = 0; i < cChars; i++)
-    {
-        if (pwLogClust[i] > log_clust_max)
-            log_clust_max = pwLogClust[i];
-    }
+    if (pwLogClust[0] > pwLogClust[cChars-1])
+        log_clust_max = pwLogClust[0];
+    else
+        log_clust_max = pwLogClust[cChars-1];
 
     if (glyph > log_clust_max)
         return advance;




More information about the wine-cvs mailing list