aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-10-06 18:35:41 +0200
committerMax Kellermann <max@duempel.org>2008-10-06 18:35:41 +0200
commitfb4d55c5b37cd2f70b4cc3b3aed5d851fe67a7e6 (patch)
treebb9b2813911f0bbc1037d1de8c792ca888377b74 /src
parent8faf6487842366dc216101b211a92d382d0a7839 (diff)
downloadmpd-fb4d55c5b37cd2f70b4cc3b3aed5d851fe67a7e6.tar.gz
mpd-fb4d55c5b37cd2f70b4cc3b3aed5d851fe67a7e6.tar.xz
mpd-fb4d55c5b37cd2f70b4cc3b3aed5d851fe67a7e6.zip
tag: merge clearMpdTag into tag_free
avoid some redundant clearing logic as well, since the tag is getting freed.
Diffstat (limited to 'src')
-rw-r--r--src/tag.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/tag.c b/src/tag.c
index dc2037473..28f1d6eae 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -273,12 +273,12 @@ void tag_clear_items_by_type(struct tag *tag, enum tag_type type)
}
}
-static void clearMpdTag(struct tag *tag)
+void tag_free(struct tag *tag)
{
int i;
pthread_mutex_lock(&tag_pool_lock);
- for (i = 0; i < tag->numOfItems; i++)
+ for (i = tag->numOfItems; --i >= 0; )
tag_pool_put_item(tag->items[i]);
pthread_mutex_unlock(&tag_pool_lock);
@@ -291,16 +291,6 @@ static void clearMpdTag(struct tag *tag)
free(tag->items);
}
- tag->items = NULL;
-
- tag->numOfItems = 0;
-
- tag->time = -1;
-}
-
-void tag_free(struct tag *tag)
-{
- clearMpdTag(tag);
free(tag);
}