summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAlex Martelli <aleaxit@gmail.com>2003-10-25 12:49:56 (GMT)
committerAlex Martelli <aleaxit@gmail.com>2003-10-25 12:49:56 (GMT)
commita2777d3a55ca75f199ab4cedd8653104f2bcf40e (patch)
tree14e28b8cbb54273bd2384170ea672c52a93930c2 /Python
parent5cf6394b126bcbc7a3e97d88b8b2d6fd51f3bee7 (diff)
downloadcpython-a2777d3a55ca75f199ab4cedd8653104f2bcf40e.zip
cpython-a2777d3a55ca75f199ab4cedd8653104f2bcf40e.tar.gz
cpython-a2777d3a55ca75f199ab4cedd8653104f2bcf40e.tar.bz2
Changed builtin_sum to use PyNumber_InPlaceAdd (same semantics, but fixes
a performance bug in sum(manylists)), same as in 2.3 maintenance branch.
Diffstat (limited to 'Python')
-rw-r--r--Python/bltinmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index 0309f1de..718b603 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -1840,7 +1840,7 @@ builtin_sum(PyObject *self, PyObject *args)
}
break;
}
- temp = PyNumber_Add(result, item);
+ temp = PyNumber_InPlaceAdd(result, item);
Py_DECREF(result);
Py_DECREF(item);
result = temp;