a few peephole optimizations

This commit is contained in:
Guido van Rossum 1995-03-09 12:12:50 +00:00
parent 8d617a60b1
commit 5fe605889a
5 changed files with 12 additions and 8 deletions

View file

@ -419,7 +419,7 @@ string_hash(a)
p = (unsigned char *) a->ob_sval;
x = *p << 7;
while (--len >= 0)
x = (x + x + x) ^ *p++;
x = (3*x) ^ *p++;
x ^= a->ob_size;
if (x == -1)
x = -2;