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); \
|
assert (key < d->count); \
|
||||||
const size_t index0 = d->front->index; \
|
const size_t index0 = d->front->index; \
|
||||||
size_t count = 0; \
|
size_t count = 0; \
|
||||||
M_C(name, _node_list_it_t) it; \
|
|
||||||
/* This loop is in log(N) since the size increase exponentially.*/ \
|
/* This loop is in log(N) since the size increase exponentially.*/ \
|
||||||
for(M_C(name, _node_list_it)(it, d->list) ; \
|
for(M_C(name, _node_t) *n = d->front->node; \
|
||||||
!M_C(name, _node_list_end_p)(it) ; \
|
n != NULL ; \
|
||||||
M_C(name, _node_list_next)(it) ){ \
|
n = (n == d->back->node) ? NULL : \
|
||||||
M_C(name, _node_t) *n = M_C(name, _node_list_ref)(it); \
|
M_C(name, _node_list_next_obj)(d->list, n) ){ \
|
||||||
if (index0 + key < count + n->size) { \
|
if (index0 + key < count + n->size) { \
|
||||||
return &n->data[index0 + key - count]; \
|
return &n->data[index0 + key - count]; \
|
||||||
} \
|
} \
|
||||||
|
|||||||
Reference in new issue
Block a user