MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / swapItems

Function swapItems

src/PyListProxyHandler.cc:1625–1634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1623
1624
1625static void swapItems(PyObject *list, int i, int j) {
1626 if (i != j) {
1627 PyObject *list_i = PyList_GetItem(list, i);
1628 PyObject *list_j = PyList_GetItem(list, j);
1629 Py_INCREF(list_i);
1630 Py_INCREF(list_j);
1631 PyList_SetItem(list, i, list_j);
1632 PyList_SetItem(list, j, list_i);
1633 }
1634}
1635
1636static int invokeCallBack(PyObject *list, int index, JS::HandleValue leftValue, JSContext *cx, JS::HandleFunction callBack) {
1637 JS::Rooted<JS::ValueArray<2>> jArgs(cx);

Callers 1

quickSortFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected