Merge branch 'develop' into #3-issue
This commit is contained in:
commit
902e1cb86c
@ -169,17 +169,14 @@ size_t list_slice(list_t* x, list_t* s, ssize_t i, size_t n, _Bool cut) {
|
||||
} else {
|
||||
if (c->prev) {
|
||||
c->prev->next = e->next;
|
||||
} else x->first = e->next;
|
||||
} else s->first = e->next;
|
||||
|
||||
if (e->next) {
|
||||
e->next->prev = c->prev;
|
||||
} else s->last = c->prev;
|
||||
|
||||
e->next = nullptr;
|
||||
c->prev = nullptr;
|
||||
|
||||
x->first = c;
|
||||
x->last = e;
|
||||
(x->first = c)->prev = nullptr;
|
||||
(x->last = e)->next = nullptr;
|
||||
}
|
||||
|
||||
return r;
|
||||
|
@ -34,7 +34,7 @@ void list_sort(list_t* x) {
|
||||
lnode_t *p = l->prev;
|
||||
|
||||
for (lnode_t* c = l; c != r; c = c->next) {
|
||||
if (lnode_compare(c, r) < 0) {
|
||||
if (lnode_compare(c, r) <= 0) {
|
||||
p = (is_null(p)) ? l : p->next;
|
||||
lnode_swap(p, c);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user