aboutsummaryrefslogtreecommitdiff
path: root/src/playlist/SoundCloudPlaylistPlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-29 18:51:40 +0100
committerMax Kellermann <max@duempel.org>2013-01-29 20:32:54 +0100
commit8cad20585dbbf5987d6649bea9c6b6ba688b7bff (patch)
treeb93e9dbd1e3f6e8f895ea53b2d5bfec09e6fab46 /src/playlist/SoundCloudPlaylistPlugin.cxx
parenta8b75dc4df3bf3ba9a1554249cf6d07527184864 (diff)
playlist/memory: use std::forward_list instead of GSList
Diffstat (limited to 'src/playlist/SoundCloudPlaylistPlugin.cxx')
-rw-r--r--src/playlist/SoundCloudPlaylistPlugin.cxx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/playlist/SoundCloudPlaylistPlugin.cxx b/src/playlist/SoundCloudPlaylistPlugin.cxx
index b236481a..5a258865 100644
--- a/src/playlist/SoundCloudPlaylistPlugin.cxx
+++ b/src/playlist/SoundCloudPlaylistPlugin.cxx
@@ -101,7 +101,8 @@ struct parse_data {
long duration;
char* title;
int got_url; /* nesting level of last stream_url */
- GSList* songs;
+
+ std::forward_list<SongPointer> songs;
};
static int handle_integer(void *ctx,
@@ -215,7 +216,7 @@ static int handle_end_map(void *ctx)
tag_add_item(t, TAG_NAME, data->title);
s->tag = t;
- data->songs = g_slist_prepend(data->songs, s);
+ data->songs.emplace_front(s);
return 1;
}
@@ -370,7 +371,6 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond)
struct parse_data data;
data.got_url = 0;
- data.songs = NULL;
data.title = NULL;
data.stream_url = NULL;
#ifdef HAVE_YAJL1
@@ -391,7 +391,8 @@ soundcloud_open_uri(const char *uri, Mutex &mutex, Cond &cond)
if (ret == -1)
return NULL;
- return new MemoryPlaylistProvider(g_slist_reverse(data.songs));
+ data.songs.reverse();
+ return new MemoryPlaylistProvider(std::move(data.songs));
}
static const char *const soundcloud_schemes[] = {