Skip to content

Commit 397f3e4

Browse files
committed
review comments
1 parent b0c486f commit 397f3e4

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

Modules/_json.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,6 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
998998
Py_ssize_t idx = start;
999999
int is_float = 0;
10001000
PyObject *rval;
1001-
PyObject *numstr = NULL;
10021001
PyObject *custom_func;
10031002

10041003
str = PyUnicode_DATA(pystr);
@@ -1065,17 +1064,16 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
10651064

10661065
if (custom_func) {
10671066
/* copy the section we determined to be a number */
1068-
numstr = PyUnicode_FromKindAndData(kind,
1069-
(char*)str + kind * start,
1070-
idx - start);
1067+
PyObject *numstr = PyUnicode_FromKindAndData(kind,
1068+
(char*)str + kind * start,
1069+
idx - start);
10711070
if (numstr == NULL)
10721071
return NULL;
10731072
rval = PyObject_CallOneArg(custom_func, numstr);
10741073
Py_DECREF(numstr);
10751074
}
10761075
else {
10771076
Py_ssize_t i, n;
1078-
char *buf;
10791077

10801078
/* Fast path for integers with at most 19 digits (excluding the
10811079
optional minus sign): the magnitude always fits in an unsigned
@@ -1100,6 +1098,8 @@ _match_number_unicode(PyScannerObject *s, PyObject *pystr, Py_ssize_t start, Py_
11001098
decimal unicode digits (which cannot appear here) */
11011099
n = idx - start;
11021100
char stackbuf[64];
1101+
PyObject *numstr = NULL;
1102+
char *buf;
11031103
if (n < (Py_ssize_t)sizeof(stackbuf)) {
11041104
buf = stackbuf;
11051105
buf[n] = '\0';

0 commit comments

Comments
 (0)