diff options
author | Max Kellermann <max@duempel.org> | 2014-01-18 15:44:41 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-01-18 15:44:41 +0100 |
commit | 5409e43fb557ca3275675c9a7e1968590dbb0276 (patch) | |
tree | e5b9fc26b91e52b6520e137d8c2207924ee0f4d7 /src/db/upnp/Directory.cxx | |
parent | f33f891c54b22233083e82e3743af5ca74a85128 (diff) | |
download | mpd-5409e43fb557ca3275675c9a7e1968590dbb0276.tar.gz mpd-5409e43fb557ca3275675c9a7e1968590dbb0276.tar.xz mpd-5409e43fb557ca3275675c9a7e1968590dbb0276.zip |
db/upnp: cache m_path.back()
Diffstat (limited to '')
-rw-r--r-- | src/db/upnp/Directory.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/db/upnp/Directory.cxx b/src/db/upnp/Directory.cxx index b9c92dabd..ce0a86fda 100644 --- a/src/db/upnp/Directory.cxx +++ b/src/db/upnp/Directory.cxx @@ -156,10 +156,11 @@ protected: virtual void CharacterData(const XML_Char *s, int len) { + const auto ¤t = m_path.back(); std::string str = trimstring(s, len); TagType type = tag_table_lookup(upnp_tags, - m_path.back().c_str()); + current.c_str()); if (type != TAG_NUM_OF_ITEM_TYPES) { tag.AddItem(type, str.c_str()); @@ -169,14 +170,14 @@ protected: return; } - switch (m_path.back()[0]) { + switch (current[0]) { case 'r': - if (!m_path.back().compare("res")) { + if (!current.compare("res")) { m_tobj.url = std::move(str); } break; case 'u': - if (m_path.back() == "upnp:class") { + if (current == "upnp:class") { m_tobj.item_class = ParseItemClass(str.c_str()); break; } |