Skip to content

Commit 2f7ba4e

Browse files
authored
[mypyc] Remove the unused CPyList_GetItemUnsafe primitive (#19424)
We now generate low-level IR directly instead of calling a primitive function.
1 parent d0962df commit 2f7ba4e

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

mypyc/lib-rt/CPy.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,6 @@ PyObject *CPyObject_GetSlice(PyObject *obj, CPyTagged start, CPyTagged end);
646646

647647
PyObject *CPyList_Build(Py_ssize_t len, ...);
648648
PyObject *CPyList_GetItem(PyObject *list, CPyTagged index);
649-
PyObject *CPyList_GetItemUnsafe(PyObject *list, CPyTagged index);
650649
PyObject *CPyList_GetItemShort(PyObject *list, CPyTagged index);
651650
PyObject *CPyList_GetItemBorrow(PyObject *list, CPyTagged index);
652651
PyObject *CPyList_GetItemShortBorrow(PyObject *list, CPyTagged index);

mypyc/lib-rt/list_ops.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,6 @@ PyObject *CPyList_Copy(PyObject *list) {
5959
return PyObject_CallMethodNoArgs(list, name);
6060
}
6161

62-
63-
PyObject *CPyList_GetItemUnsafe(PyObject *list, CPyTagged index) {
64-
Py_ssize_t n = CPyTagged_ShortAsSsize_t(index);
65-
PyObject *result = PyList_GET_ITEM(list, n);
66-
Py_INCREF(result);
67-
return result;
68-
}
69-
7062
PyObject *CPyList_GetItemShort(PyObject *list, CPyTagged index) {
7163
Py_ssize_t n = CPyTagged_ShortAsSsize_t(index);
7264
Py_ssize_t size = PyList_GET_SIZE(list);

0 commit comments

Comments
 (0)