summaryrefslogtreecommitdiffstats
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-03-09 12:12:50 (GMT)
committerGuido van Rossum <guido@python.org>1995-03-09 12:12:50 (GMT)
commit5fe605889a52bc2a34e1d883df14e6cc56ee87a3 (patch)
tree338857070fb7a49a861c7dbb33fd47200ba35324 /Objects/stringobject.c
parent8d617a60b1d183af24278be8dc1597ee19fe7931 (diff)
downloadcpython-5fe605889a52bc2a34e1d883df14e6cc56ee87a3.zip
cpython-5fe605889a52bc2a34e1d883df14e6cc56ee87a3.tar.gz
cpython-5fe605889a52bc2a34e1d883df14e6cc56ee87a3.tar.bz2
a few peephole optimizations
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r--Objects/stringobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index cb76d77..b09fc25 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -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;