fix bad start index in cx_ll_node_at()

Sun, 03 Oct 2021 18:36:51 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 03 Oct 2021 18:36:51 +0200
changeset 457
8f7d3fe9ca40
parent 456
227c2eabbef8
child 458
da11a5a765a0

fix bad start index in cx_ll_node_at()

src/linked_list.c file | annotate | diff | comparison | revisions
     1.1 --- a/src/linked_list.c	Sun Oct 03 16:30:47 2021 +0200
     1.2 +++ b/src/linked_list.c	Sun Oct 03 18:36:51 2021 +0200
     1.3 @@ -109,7 +109,7 @@
     1.4      if (index >= list->base.size) {
     1.5          return NULL;
     1.6      } else if (index > list->base.size / 2) {
     1.7 -        return cx_linked_list_at(list->end, list->base.size, CX_LL_LOC_PREV, index);
     1.8 +        return cx_linked_list_at(list->end, list->base.size-1, CX_LL_LOC_PREV, index);
     1.9      } else {
    1.10          return cx_linked_list_at(list->begin, 0, CX_LL_LOC_NEXT, index);
    1.11      }

mercurial