From b6e6d4b5115ff46c76ad390bb518bc50df09c7cb Mon Sep 17 00:00:00 2001 From: Dan Hipschman Date: Mon, 11 Sep 2006 17:53:53 -0700 Subject: [PATCH] oleaut32: Replace a loop with a simple computation. --- dlls/oleaut32/hash.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/dlls/oleaut32/hash.c b/dlls/oleaut32/hash.c index e87267c54f6..9934b6480bd 100644 --- a/dlls/oleaut32/hash.c +++ b/dlls/oleaut32/hash.c @@ -608,13 +608,7 @@ ULONG WINAPI LHashValOfNameSysA( SYSKIND skind, LCID lcid, LPCSTR lpStr) 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) */