Fix bug in _get method of deque container.
This commit is contained in:
1 parent
608a929fcb
commit
d56b794177
1 file changed
+4
-5
@@ -680,12 +680,11 @@
|
||||
assert (key < d->count); \
|
||||
const size_t index0 = d->front->index; \
|
||||
size_t count = 0; \
|
||||
M_C(name, _node_list_it_t) it; \
|
||||
/* This loop is in log(N) since the size increase exponentially.*/ \
|
||||
for(M_C(name, _node_list_it)(it, d->list) ; \
|
||||
!M_C(name, _node_list_end_p)(it) ; \
|
||||
M_C(name, _node_list_next)(it) ){ \
|
||||
M_C(name, _node_t) *n = M_C(name, _node_list_ref)(it); \
|
||||
for(M_C(name, _node_t) *n = d->front->node; \
|
||||
n != NULL ; \
|
||||
n = (n == d->back->node) ? NULL : \
|
||||
M_C(name, _node_list_next_obj)(d->list, n) ){ \
|
||||
if (index0 + key < count + n->size) { \
|
||||
return &n->data[index0 + key - count]; \
|
||||
} \
|
||||
|
||||
Reference in new issue
Block a user