aboutsummaryrefslogtreecommitdiffstats
path: root/src/db/upnp/Directory.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-14 12:36:15 +0100
committerMax Kellermann <max@duempel.org>2014-01-14 13:37:21 +0100
commitddc75cc46b35639bfbb8fe014070d8948a259dad (patch)
treef6544564c362d8896509b145c43ae352eb607255 /src/db/upnp/Directory.cxx
parentdafd0bc49a1a2d6d60b6c3f6231e153b14bf85a1 (diff)
downloadmpd-ddc75cc46b35639bfbb8fe014070d8948a259dad.tar.gz
mpd-ddc75cc46b35639bfbb8fe014070d8948a259dad.tar.xz
mpd-ddc75cc46b35639bfbb8fe014070d8948a259dad.zip
db/upnp/Directory: merge m_containers and m_items
There is no use in duplicating these containers. It only means that we have to search both, duplicating the code.
Diffstat (limited to 'src/db/upnp/Directory.cxx')
-rw-r--r--src/db/upnp/Directory.cxx12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/db/upnp/Directory.cxx b/src/db/upnp/Directory.cxx
index cc28ec295..8a6708a67 100644
--- a/src/db/upnp/Directory.cxx
+++ b/src/db/upnp/Directory.cxx
@@ -149,15 +149,9 @@ protected:
virtual void EndElement(const XML_Char *name)
{
- if (!strcmp(name, "container")) {
- if (checkobjok()) {
- m_dir.m_containers.push_back(m_tobj);
- }
- } else if (!strcmp(name, "item")) {
- if (checkobjok()) {
- m_dir.m_items.push_back(m_tobj);
- }
- }
+ if ((!strcmp(name, "container") || !strcmp(name, "item")) &&
+ checkobjok())
+ m_dir.objects.push_back(m_tobj);
m_path.pop_back();
}