diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-01-27 00:37:59 +0100 |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-01-27 00:37:59 +0100 |
commit | 0fe894c45db5d0c2afb447f03ef7720b6dd61f24 (patch) | |
tree | 6f6a87aee38d1952b90bbe26168085b91cde8c9c /Python/Python-ast.c | |
parent | 3ad85eb401ad31a8b8ba97f5ebd8643bf5a54fbc (diff) | |
download | cpython-0fe894c45db5d0c2afb447f03ef7720b6dd61f24.tar.gz |
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.
Diffstat (limited to 'Python/Python-ast.c')
-rw-r--r-- | Python/Python-ast.c | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/Python/Python-ast.c b/Python/Python-ast.c index 4dde11f00c..1193c7c66b 100644 --- a/Python/Python-ast.c +++ b/Python/Python-ast.c @@ -753,13 +753,6 @@ static int obj2ast_object(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 (PyArena_AddPyObject(arena, obj) < 0) { *out = NULL; |