From a2777d3a55ca75f199ab4cedd8653104f2bcf40e Mon Sep 17 00:00:00 2001 From: Alex Martelli Date: Sat, 25 Oct 2003 12:49:56 +0000 Subject: [PATCH] Changed builtin_sum to use PyNumber_InPlaceAdd (same semantics, but fixes a performance bug in sum(manylists)), same as in 2.3 maintenance branch. --- Python/bltinmodule.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 0309f1de559..718b603b7d2 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;