From 4da0b8ff2e83ecea46bab85d56850851ea3c7eec Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Fri, 23 Dec 2022 00:36:11 -0800 Subject: [PATCH] Move local declarations inside the block where they are used. --- Python/bltinmodule.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index 02cb255b9a704e..43e4643c23ebe6 100644 --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -2533,7 +2533,6 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start) if (PyFloat_CheckExact(result)) { double f_result = PyFloat_AS_DOUBLE(result); double c = 0.0; - double x, t; Py_SETREF(result, NULL); while(result == NULL) { item = PyIter_Next(iter); @@ -2552,8 +2551,8 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start) if (PyFloat_CheckExact(item)) { // Improved Kahan–Babuška algorithm by Arnold Neumaier // https://www.mat.univie.ac.at/~neum/scan/01.pdf - x = PyFloat_AS_DOUBLE(item); - t = f_result + x; + double x = PyFloat_AS_DOUBLE(item); + double t = f_result + x; if (fabs(f_result) >= fabs(x)) { c += (f_result - t) + x; } else {