From da744eba5313dd59b107872b83b8ee207b71f74a Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 5 Oct 2008 16:44:59 -0700 Subject: song: get rid of newNullSong() It didn't save us any lines of code nor did it do anything useful since we would overwrite everything anyways. --- src/song.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/song.c b/src/song.c index d1a35afb3..943adfe73 100644 --- a/src/song.c +++ b/src/song.c @@ -29,18 +29,6 @@ #include "os_compat.h" -static Song *newNullSong(void) -{ - Song *song = xmalloc(sizeof(Song)); - - song->tag = NULL; - song->url = NULL; - song->type = SONG_TYPE_FILE; - song->parentDir = NULL; - - return song; -} - Song *newSong(const char *url, int type, Directory * parentDir) { Song *song; @@ -50,8 +38,8 @@ Song *newSong(const char *url, int type, Directory * parentDir) return NULL; } - song = newNullSong(); - + song = xmalloc(sizeof(Song)); + song->tag = NULL; song->url = xstrdup(url); song->type = type; song->parentDir = parentDir; @@ -169,7 +157,8 @@ void readSongInfoIntoList(FILE * fp, Directory * parentDir) if (!prefixcmp(buffer, SONG_KEY)) { if (song) insertSongIntoList(sv, song); - song = newNullSong(); + song = xmalloc(sizeof(Song)); + song->tag = NULL; song->url = xstrdup(buffer + strlen(SONG_KEY)); song->type = SONG_TYPE_FILE; song->parentDir = parentDir; -- cgit v1.2.3