]> granicus.if.org Git - php/commitdiff
The compiler can figure this out
authorGustavo Lopes <glopes@nebm.ist.utl.pt>
Wed, 9 Jan 2013 22:20:32 +0000 (23:20 +0100)
committerGustavo Lopes <gustavo@icemobile.com>
Mon, 14 Jan 2013 11:22:42 +0000 (12:22 +0100)
ext/standard/string.c

index 14259cabc03938d392fa049d115765e75bfb1951..c7ed8844f10e8439afc190130b74f828c24285ed 100644 (file)
@@ -2821,7 +2821,7 @@ static inline HASH php_strtr_hash(const char *str, int len)
        HASH    res = 0;
        int             i;
        for (i = 0; i < len; i++) {
-               res = (res << 5) + res + (unsigned char)str[i];
+               res = res * 33 + (unsigned char)str[i];
        }
 
        return res;