polish py_ring_buffer

This commit is contained in:
Dun Liang 2021-01-12 18:17:31 +08:00
parent efcb32b1e1
commit 7ebf3e8ee4
2 changed files with 3 additions and 3 deletions

View File

@ -8,7 +8,7 @@
# This file is subject to the terms and conditions defined in
# file 'LICENSE.txt', which is part of this source code package.
# ***************************************************************
__version__ = '1.2.2.15'
__version__ = '1.2.2.16'
from . import lock
with lock.lock_scope():
ori_int = int

View File

@ -170,8 +170,8 @@ static PyObject* pop_py_object(RingBuffer* rb, uint64& __restrict__ offset, bool
auto size = rb->pop_t<int64>(offset);
PyObjHolder dict(PyDict_New());
for (int64 i=0; i<size; i++) {
PyObject* key = pop_py_object(rb, offset, keep_numpy_array);
PyObject* value = pop_py_object(rb, offset, keep_numpy_array);
PyObjHolder key(pop_py_object(rb, offset, keep_numpy_array));
PyObjHolder value(pop_py_object(rb, offset, keep_numpy_array));
PyDict_SetItem(dict.obj, key, value);
}
return dict.release();