aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/UpnpDatabasePlugin.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-21 22:57:16 +0100
committerMax Kellermann <max@duempel.org>2014-01-21 22:57:16 +0100
commit94cb1545b38e5a39340a8e4da60656b7faa7920e (patch)
treea22ebc36481d8c6ba890ac465e63014449f0a61e /src/db/UpnpDatabasePlugin.cxx
parent411527a240bfed9439f94fbfdccf382beeb80151 (diff)
downloadmpd-94cb1545b38e5a39340a8e4da60656b7faa7920e.tar.gz
mpd-94cb1545b38e5a39340a8e4da60656b7faa7920e.tar.xz
mpd-94cb1545b38e5a39340a8e4da60656b7faa7920e.zip
db/upnp: use vector::front() instead of [0]
Diffstat (limited to 'src/db/UpnpDatabasePlugin.cxx')
-rw-r--r--src/db/UpnpDatabasePlugin.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx
index cbb913bef..c62700c59 100644
--- a/src/db/UpnpDatabasePlugin.cxx
+++ b/src/db/UpnpDatabasePlugin.cxx
@@ -226,12 +226,12 @@ UpnpDatabase::GetSong(const char *uri, Error &error) const
}
ContentDirectoryService server;
- if (!m_superdir->getServer(vpath[0].c_str(), server, error))
+ if (!m_superdir->getServer(vpath.front().c_str(), server, error))
return nullptr;
vpath.erase(vpath.begin());
UPnPDirObject dirent;
- if (vpath[0].compare(rootid)) {
+ if (vpath.front() != rootid) {
std::string objid;
if (!Namei(server, vpath, objid, dirent, error))
return nullptr;
@@ -433,7 +433,7 @@ UpnpDatabase::ReadNode(ContentDirectoryService &server,
return false;
if (dirbuf.objects.size() == 1) {
- dirent = std::move(dirbuf.objects[0]);
+ dirent = std::move(dirbuf.objects.front());
} else {
error.Format(upnp_domain, "Bad resource");
return false;
@@ -547,7 +547,7 @@ UpnpDatabase::VisitServer(ContentDirectoryService &server,
/* !Note: this *can't* be handled by Namei further down,
because the path is not valid for traversal. Besides, it's
just faster to access the target node directly */
- if (!vpath.empty() && !vpath[0].compare(rootid)) {
+ if (!vpath.empty() && vpath.front() == rootid) {
if (visit_song) {
UPnPDirObject dirent;
if (!ReadNode(server, vpath.back().c_str(), dirent,
@@ -713,7 +713,7 @@ UpnpDatabase::Visit(const DatabaseSelection &selection,
}
// We do have a path: the first element selects the server
- std::string servername(vpath[0]);
+ std::string servername(vpath.front());
vpath.erase(vpath.begin());
ContentDirectoryService server;