Issue #26146: remove useless code

obj2ast_constant() code is baesd on obj2ast_object() which has a special case
for Py_None. But in practice, we don't need to have a special case for
constants.

Issue noticed by Joseph Jevnik on a review.
This commit is contained in:
Victor Stinner 2016-01-27 00:37:59 +01:00
parent 726f6902ce
commit 25219f596a
2 changed files with 0 additions and 14 deletions

View File

@ -874,13 +874,6 @@ static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena)
static int obj2ast_constant(PyObject* obj, PyObject** out, PyArena* arena) static int obj2ast_constant(PyObject* obj, PyObject** out, PyArena* arena)
{ {
if (obj == Py_None || obj == Py_True || obj == Py_False) {
/* don't increment the reference counter, Constant uses a borrowed
* reference, not a strong reference */
*out = obj;
return 0;
}
if (obj) { if (obj) {
if (PyArena_AddPyObject(arena, obj) < 0) { if (PyArena_AddPyObject(arena, obj) < 0) {
*out = NULL; *out = NULL;

View File

@ -753,13 +753,6 @@ static int obj2ast_object(PyObject* obj, PyObject** out, PyArena* arena)
static int obj2ast_constant(PyObject* obj, PyObject** out, PyArena* arena) static int obj2ast_constant(PyObject* obj, PyObject** out, PyArena* arena)
{ {
if (obj == Py_None || obj == Py_True || obj == Py_False) {
/* don't increment the reference counter, Constant uses a borrowed
* reference, not a strong reference */
*out = obj;
return 0;
}
if (obj) { if (obj) {
if (PyArena_AddPyObject(arena, obj) < 0) { if (PyArena_AddPyObject(arena, obj) < 0) {
*out = NULL; *out = NULL;