From 6f4b83bce07100bdef792238260c66a1fa6bd589 Mon Sep 17 00:00:00 2001 From: Dan Hipschman Date: Mon, 11 Sep 2006 17:53:53 -0700 Subject: [PATCH] widl: Replace a loop with a simple computation. --- tools/widl/hash.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tools/widl/hash.c b/tools/widl/hash.c index d67cb6b16a0..2d6f1d302d6 100644 --- a/tools/widl/hash.c +++ b/tools/widl/hash.c @@ -605,13 +605,7 @@ unsigned long lhash_val_of_name_sys( syskind_t 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) */