mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 19:36:18 +01:00
Remove bits of dead code identified by coverage tests
These lines could were not hit by our tests, and examination of the code reveals that they can't ever be hit.
This commit is contained in:
parent
b74f46db6b
commit
1fe4429318
16
glib/glist.c
16
glib/glist.c
@ -310,28 +310,24 @@ g_list_insert (GList *list,
|
|||||||
{
|
{
|
||||||
GList *new_list;
|
GList *new_list;
|
||||||
GList *tmp_list;
|
GList *tmp_list;
|
||||||
|
|
||||||
if (position < 0)
|
if (position < 0)
|
||||||
return g_list_append (list, data);
|
return g_list_append (list, data);
|
||||||
else if (position == 0)
|
else if (position == 0)
|
||||||
return g_list_prepend (list, data);
|
return g_list_prepend (list, data);
|
||||||
|
|
||||||
tmp_list = g_list_nth (list, position);
|
tmp_list = g_list_nth (list, position);
|
||||||
if (!tmp_list)
|
if (!tmp_list)
|
||||||
return g_list_append (list, data);
|
return g_list_append (list, data);
|
||||||
|
|
||||||
new_list = _g_list_alloc ();
|
new_list = _g_list_alloc ();
|
||||||
new_list->data = data;
|
new_list->data = data;
|
||||||
new_list->prev = tmp_list->prev;
|
new_list->prev = tmp_list->prev;
|
||||||
if (tmp_list->prev)
|
tmp_list->prev->next = new_list;
|
||||||
tmp_list->prev->next = new_list;
|
|
||||||
new_list->next = tmp_list;
|
new_list->next = tmp_list;
|
||||||
tmp_list->prev = new_list;
|
tmp_list->prev = new_list;
|
||||||
|
|
||||||
if (tmp_list == list)
|
return list;
|
||||||
return new_list;
|
|
||||||
else
|
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -316,16 +316,8 @@ g_slist_insert (GSList *list,
|
|||||||
tmp_list = tmp_list->next;
|
tmp_list = tmp_list->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (prev_list)
|
new_list->next = prev_list->next;
|
||||||
{
|
prev_list->next = new_list;
|
||||||
new_list->next = prev_list->next;
|
|
||||||
prev_list->next = new_list;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
new_list->next = list;
|
|
||||||
list = new_list;
|
|
||||||
}
|
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user