aboutsummaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-21 23:10:30 +0100
committerMax Kellermann <max@duempel.org>2014-01-21 23:10:30 +0100
commit7260d7883ce98299126b850e6c1559d2597914fa (patch)
tree963ce96658764e8e8114a0530e19b314bbfbb7ae /src/db
parent154250f551468c58116e2d558726022d2cd9a199 (diff)
downloadmpd-7260d7883ce98299126b850e6c1559d2597914fa.tar.gz
mpd-7260d7883ce98299126b850e6c1559d2597914fa.tar.xz
mpd-7260d7883ce98299126b850e6c1559d2597914fa.zip
db/upnp: move "objid" declaration down
Don't allocate the object when it's not needed.
Diffstat (limited to 'src/db')
-rw-r--r--src/db/UpnpDatabasePlugin.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/db/UpnpDatabasePlugin.cxx b/src/db/UpnpDatabasePlugin.cxx
index cd3b8afbd..0307a984f 100644
--- a/src/db/UpnpDatabasePlugin.cxx
+++ b/src/db/UpnpDatabasePlugin.cxx
@@ -467,8 +467,6 @@ UpnpDatabase::Namei(ContentDirectoryService &server,
UPnPDirObject &odirent,
Error &error) const
{
- std::string objid(rootid);
-
if (vpath.empty()) {
// looking for root info
if (!ReadNode(server, rootid, odirent, error))
@@ -479,6 +477,8 @@ UpnpDatabase::Namei(ContentDirectoryService &server,
const UpnpClient_Handle handle = m_lib->getclh();
+ std::string objid(rootid);
+
// Walk the path elements, read each directory and try to find the next one
for (unsigned int i = 0; i < vpath.size(); i++) {
UPnPDirContent dirbuf;