mirror of
https://gitlab.com/libvirt/libvirt-python.git
synced 2024-10-26 07:55:06 +03:00
Use PySequence_GetItem preferentially
Although marginally faster, PySequence_ITEM is not part of the stable API and also omits some safety checks. It is better for us to be using PySequence_GetItem instead. Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
85e58cb2ee
commit
f76708b8fa
@ -534,7 +534,7 @@ virPyDictToTypedParams(PyObject *dict,
|
|||||||
Py_ssize_t i, size = PySequence_Size(value);
|
Py_ssize_t i, size = PySequence_Size(value);
|
||||||
|
|
||||||
for (i = 0; i < size; i++) {
|
for (i = 0; i < size; i++) {
|
||||||
PyObject *v = PySequence_ITEM(value, i);
|
PyObject *v = PySequence_GetItem(value, i);
|
||||||
if (virPyDictToTypedParamOne(¶ms, &n, &max,
|
if (virPyDictToTypedParamOne(¶ms, &n, &max,
|
||||||
hints, nhints, keystr, v) < 0)
|
hints, nhints, keystr, v) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user