We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f6e807f commit b3b49ecCopy full SHA for b3b49ec
1 file changed
orderbook/sorteddict.c
@@ -213,6 +213,13 @@ inline int update_keys(SortedDict *self) {
213
}
214
215
216
+ /*
217
+ It does seem like this code isnt necessarily needed.
218
+ the PyDict_Keys function above returns a PyListObject which
219
+ should suffice. It isnt strictly necessary to convert it to a tuple.
220
+ After more extensive testing, this will be cleaned up
221
+ should it prove to really be unnecessary.
222
+
223
PyObject *ret = PySequence_Tuple(keys);
224
Py_DECREF(keys);
225
if (EXPECT(!ret, 0)) {
@@ -221,9 +228,9 @@ inline int update_keys(SortedDict *self) {
228
229
if (self->keys) {
230
Py_DECREF(self->keys);
- }
-
226
- self->keys = ret;
231
+ }*/
232
+ Py_CLEAR(self->keys);
233
+ self->keys = keys;
227
234
self->dirty = false;
235
236
return 0;
0 commit comments