summaryrefslogtreecommitdiffstats
path: root/Modules/_bisectmodule.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2013-11-07 17:46:53 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2013-11-07 17:46:53 (GMT)
commite75fc148136bbef192c5572c14f3abf1f67abc57 (patch)
treefd2dc5da77e9fb8b242979d94a20242c3b6d5d80 /Modules/_bisectmodule.c
parentd0293596b85f362be990dcb4892ba7c544f51fb8 (diff)
downloadcpython-e75fc148136bbef192c5572c14f3abf1f67abc57.zip
cpython-e75fc148136bbef192c5572c14f3abf1f67abc57.tar.gz
cpython-e75fc148136bbef192c5572c14f3abf1f67abc57.tar.bz2
Issue #19514: Deduplicate some _Py_IDENTIFIER declarations.
Patch by Andrei Dorian Duma.
Diffstat (limited to 'Modules/_bisectmodule.c')
-rw-r--r--Modules/_bisectmodule.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/Modules/_bisectmodule.c b/Modules/_bisectmodule.c
index faca8cf..02b55d1 100644
--- a/Modules/_bisectmodule.c
+++ b/Modules/_bisectmodule.c
@@ -6,6 +6,8 @@ Converted to C by Dmitry Vasiliev (dima at hlabs.spb.ru).
#define PY_SSIZE_T_CLEAN
#include "Python.h"
+_Py_IDENTIFIER(insert);
+
static Py_ssize_t
internal_bisect_right(PyObject *list, PyObject *item, Py_ssize_t lo, Py_ssize_t hi)
{
@@ -90,8 +92,6 @@ insort_right(PyObject *self, PyObject *args, PyObject *kw)
if (PyList_Insert(list, index, item) < 0)
return NULL;
} else {
- _Py_IDENTIFIER(insert);
-
result = _PyObject_CallMethodId(list, &PyId_insert, "nO", index, item);
if (result == NULL)
return NULL;
@@ -195,7 +195,6 @@ insort_left(PyObject *self, PyObject *args, PyObject *kw)
if (PyList_Insert(list, index, item) < 0)
return NULL;
} else {
- _Py_IDENTIFIER(insert);
result = _PyObject_CallMethodId(list, &PyId_insert, "nO", index, item);
if (result == NULL)
return NULL;