aboutsummaryrefslogtreecommitdiffstats
path: root/src/PlaylistDatabase.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-02 22:16:52 +0100
committerMax Kellermann <max@duempel.org>2013-01-03 02:25:06 +0100
commit9023ba4a81d597c8694432655833cf23d83c6cde (patch)
tree304c2465ea160297dff17302f36c4cc38687ccb6 /src/PlaylistDatabase.cxx
parent83488848e1091024a0a307b1539c1a85762ee1f1 (diff)
downloadmpd-9023ba4a81d597c8694432655833cf23d83c6cde.tar.gz
mpd-9023ba4a81d597c8694432655833cf23d83c6cde.tar.xz
mpd-9023ba4a81d597c8694432655833cf23d83c6cde.zip
PlaylistVector: use std::list
Diffstat (limited to '')
-rw-r--r--src/PlaylistDatabase.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/PlaylistDatabase.cxx b/src/PlaylistDatabase.cxx
index bbfdf7481..4604a8956 100644
--- a/src/PlaylistDatabase.cxx
+++ b/src/PlaylistDatabase.cxx
@@ -36,18 +36,17 @@ playlist_database_quark(void)
}
void
-playlist_vector_save(FILE *fp, const struct list_head *pv)
+playlist_vector_save(FILE *fp, const PlaylistVector &pv)
{
- PlaylistInfo *pm;
- playlist_vector_for_each(pm, pv)
+ for (const PlaylistInfo &pi : pv)
fprintf(fp, PLAYLIST_META_BEGIN "%s\n"
"mtime: %li\n"
"playlist_end\n",
- pm->name.c_str(), (long)pm->mtime);
+ pi.name.c_str(), (long)pi.mtime);
}
bool
-playlist_metadata_load(FILE *fp, struct list_head *pv, const char *name,
+playlist_metadata_load(FILE *fp, PlaylistVector &pv, const char *name,
GString *buffer, GError **error_r)
{
PlaylistInfo pm(name, 0);
@@ -76,6 +75,6 @@ playlist_metadata_load(FILE *fp, struct list_head *pv, const char *name,
}
}
- playlist_vector_update_or_add(pv, std::move(pm));
+ pv.UpdateOrInsert(std::move(pm));
return true;
}