Author: Konstantin Lopuhin <[email protected]>
Branch: unquote-faster
Changeset: r61134:134dddef38b4
Date: 2013-02-12 17:01 +0400
http://bitbucket.org/pypy/pypy/changeset/134dddef38b4/

Log:    avoid extra copy

diff --git a/lib-python/2.7/urllib.py b/lib-python/2.7/urllib.py
--- a/lib-python/2.7/urllib.py
+++ b/lib-python/2.7/urllib.py
@@ -1206,7 +1206,8 @@
     if len(res) == 1:
         return s
     res_list = [res[0]]
-    for item in res[1:]:
+    for j in xrange(1, len(res)):
+        item = res[j]
         try:
             x = _hextochr[item[:2]] + item[2:]
         except KeyError:
diff --git a/lib-python/2.7/urlparse.py b/lib-python/2.7/urlparse.py
--- a/lib-python/2.7/urlparse.py
+++ b/lib-python/2.7/urlparse.py
@@ -322,7 +322,8 @@
     if len(res) == 1:
         return s
     res_list = [res[0]]
-    for item in res[1:]:
+    for j in xrange(1, len(res)):
+        item = res[j]
         try:
             x = _hextochr[item[:2]] + item[2:]
         except KeyError:
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to