Skip to content

Commit 4da0b8f

Browse files
committed
Move local declarations inside the block where they are used.
1 parent 4f4b731 commit 4da0b8f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Python/bltinmodule.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2533,7 +2533,6 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
25332533
if (PyFloat_CheckExact(result)) {
25342534
double f_result = PyFloat_AS_DOUBLE(result);
25352535
double c = 0.0;
2536-
double x, t;
25372536
Py_SETREF(result, NULL);
25382537
while(result == NULL) {
25392538
item = PyIter_Next(iter);
@@ -2552,8 +2551,8 @@ builtin_sum_impl(PyObject *module, PyObject *iterable, PyObject *start)
25522551
if (PyFloat_CheckExact(item)) {
25532552
// Improved Kahan–Babuška algorithm by Arnold Neumaier
25542553
// https://www.mat.univie.ac.at/~neum/scan/01.pdf
2555-
x = PyFloat_AS_DOUBLE(item);
2556-
t = f_result + x;
2554+
double x = PyFloat_AS_DOUBLE(item);
2555+
double t = f_result + x;
25572556
if (fabs(f_result) >= fabs(x)) {
25582557
c += (f_result - t) + x;
25592558
} else {

0 commit comments

Comments
 (0)