diff Objects/stringobject.c @ 2504:425835b88099 legacy-trunk

a few peephole optimizations
author Guido van Rossum <guido@python.org>
date Thu, 09 Mar 1995 12:12:50 +0000
parents 445bea8ceab1
children ca6b60d4ea90
line wrap: on
line diff
--- a/Objects/stringobject.c	Thu Mar 09 12:12:11 1995 +0000
+++ b/Objects/stringobject.c	Thu Mar 09 12:12:50 1995 +0000
@@ -419,7 +419,7 @@
 	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;