summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2021-04-12 08:04:24 +0200
committerKim Woelders <kim@woelders.dk>2021-07-13 08:20:11 +0200
commit651c56bb295ebd3b0ceedb8cd60ba35c275e8e93 (patch)
tree305bed7a349320c1a81480401ffc9d1dfe473d58
parentc31a5b98a220234416fab2ef9cec194dc048198e (diff)
downloadimlib2-651c56bb295ebd3b0ceedb8cd60ba35c275e8e93.tar.gz
Drop unused Imlib_Object_List:last
-rw-r--r--src/lib/font.h1
-rw-r--r--src/lib/font_main.c21
2 files changed, 8 insertions, 14 deletions
diff --git a/src/lib/font.h b/src/lib/font.h
index af791c3..e9b86fd 100644
--- a/src/lib/font.h
+++ b/src/lib/font.h
@@ -15,7 +15,6 @@ typedef struct _Imlib_Hash_El Imlib_Hash_El;
struct _Imlib_Object_List {
Imlib_Object_List *next, *prev;
- Imlib_Object_List *last;
};
struct _Imlib_Hash {
diff --git a/src/lib/font_main.c b/src/lib/font_main.c
index e3b6eb5..d83858c 100644
--- a/src/lib/font_main.c
+++ b/src/lib/font_main.c
@@ -190,13 +190,10 @@ __imlib_object_list_prepend(void *in_list, void *in_item)
if (!list)
{
new_l->next = NULL;
- new_l->last = new_l;
return new_l;
}
new_l->next = list;
list->prev = new_l;
- new_l->last = list->last;
- list->last = NULL;
return new_l;
}
@@ -204,18 +201,18 @@ void *
__imlib_object_list_remove(void *in_list, void *in_item)
{
Imlib_Object_List *return_l;
- Imlib_Object_List *list, *item;
+ Imlib_Object_List *list = in_list;
+ Imlib_Object_List *item = in_item;
/* checkme */
- if (!in_list)
- return in_list;
-
- list = in_list;
- item = in_item;
+ if (!list)
+ return list;
if (!item)
return list;
+
if (item->next)
item->next->prev = item->prev;
+
if (item->prev)
{
item->prev->next = item->next;
@@ -224,13 +221,11 @@ __imlib_object_list_remove(void *in_list, void *in_item)
else
{
return_l = item->next;
- if (return_l)
- return_l->last = list->last;
}
- if (item == list->last)
- list->last = item->prev;
+
item->next = NULL;
item->prev = NULL;
+
return return_l;
}