mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-27 23:20:40 +00:00
Fix latest covs
This commit is contained in:
parent
f19b34edf8
commit
8b8151d12e
@ -269,6 +269,8 @@ static int cmp (const void *a, const void *b) {
|
||||
free (db);
|
||||
return ret;
|
||||
}
|
||||
free (da);
|
||||
free (db);
|
||||
return strcmp (a, b);
|
||||
}
|
||||
|
||||
|
@ -501,8 +501,7 @@ static RListIter * _merge_sort(RListIter *head, RListComparator cmp) {
|
||||
}
|
||||
|
||||
R_API void r_list_merge_sort(RList *list, RListComparator cmp) {
|
||||
if (!list->sorted) {
|
||||
if (list && list->head && cmp) {
|
||||
if (list && !list->sorted && list->head && cmp) {
|
||||
RListIter *iter;
|
||||
list->head = _merge_sort (list->head, cmp);
|
||||
//update tail reference
|
||||
@ -514,13 +513,12 @@ R_API void r_list_merge_sort(RList *list, RListComparator cmp) {
|
||||
}
|
||||
list->sorted = true;
|
||||
}
|
||||
}
|
||||
|
||||
R_API void r_list_insertion_sort(RList *list, RListComparator cmp) {
|
||||
if (!list->sorted) {
|
||||
if (list && !list->sorted) {
|
||||
RListIter *it;
|
||||
RListIter *it2;
|
||||
if (list && cmp) {
|
||||
if (cmp) {
|
||||
for (it = list->head; it && it->data; it = it->n) {
|
||||
for (it2 = it->n; it2 && it2->data; it2 = it2->n) {
|
||||
if (cmp (it->data, it2->data) > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user