Dan Hipschman : oleaut32: Replace a loop with a simple computation.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Sep 12 07:30:19 CDT 2006


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

Author: Dan Hipschman <dsh at linux.ucla.edu>
Date:   Mon Sep 11 17:53:53 2006 -0700

oleaut32: Replace a loop with a simple computation.

---

 dlls/oleaut32/hash.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)

diff --git a/dlls/oleaut32/hash.c b/dlls/oleaut32/hash.c
index e87267c..9934b64 100644
--- a/dlls/oleaut32/hash.c
+++ b/dlls/oleaut32/hash.c
@@ -608,13 +608,7 @@ ULONG WINAPI LHashValOfNameSysA( SYSKIND
 
   while (*str)
   {
-    ULONG newLoWord = 0, i;
-
-    /* Cumulative prime multiplication (*37) with modulo 2^32 wrap-around */
-    for (i = 0; i < 37; i++)
-      newLoWord += nLoWord;
-
-    nLoWord = newLoWord + pnLookup[*str > 0x7f && nMask ? *str + 0x80 : *str];
+    nLoWord = 37 * nLoWord + pnLookup[*str > 0x7f && nMask ? *str + 0x80 : *str];
     str++;
   }
   /* Constrain to a prime modulo and sizeof(WORD) */




More information about the wine-cvs mailing list