diff options
author | Max Kellermann <max@duempel.org> | 2014-01-10 22:03:01 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-10 22:59:28 +0100 |
commit | 1b8053a618a84122367699a24f6b2b871f1f2100 (patch) | |
tree | fb705f39433d320afef6859eea6e516e4bb4afb0 /src/db/upnp/Directory.cxx | |
parent | 70e5ab3fdee865f03eeaffcdd96155b67d5520c0 (diff) | |
download | mpd-1b8053a618a84122367699a24f6b2b871f1f2100.tar.gz mpd-1b8053a618a84122367699a24f6b2b871f1f2100.tar.xz mpd-1b8053a618a84122367699a24f6b2b871f1f2100.zip |
db/upnp/Directory: simplify checkobjok()
Diffstat (limited to 'src/db/upnp/Directory.cxx')
-rw-r--r-- | src/db/upnp/Directory.cxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/db/upnp/Directory.cxx b/src/db/upnp/Directory.cxx index 4a6f20185..bc871a448 100644 --- a/src/db/upnp/Directory.cxx +++ b/src/db/upnp/Directory.cxx @@ -126,21 +126,21 @@ protected: } bool checkobjok() { - bool ok = !m_tobj.m_id.empty() && !m_tobj.m_pid.empty() && - !m_tobj.m_title.empty(); + if (m_tobj.m_id.empty() || m_tobj.m_pid.empty() || + m_tobj.m_title.empty()) + return false; - if (ok && m_tobj.type == UPnPDirObject::Type::ITEM) { + if (m_tobj.type == UPnPDirObject::Type::ITEM) { const char *item_class_name = m_tobj.m_props["upnp:class"].c_str(); auto item_class = ParseItemClass(item_class_name); - if (item_class == UPnPDirObject::ItemClass::UNKNOWN) { - ok = false; - } else { - m_tobj.item_class = item_class; - } + if (item_class == UPnPDirObject::ItemClass::UNKNOWN) + return false; + + m_tobj.item_class = item_class; } - return ok; + return true; } virtual void EndElement(const XML_Char *name) |