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/Device.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/Device.cxx | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/db/upnp/Device.cxx b/src/db/upnp/Device.cxx index 413d6ac99..e668f839a 100644 --- a/src/db/upnp/Device.cxx +++ b/src/db/upnp/Device.cxx @@ -55,43 +55,44 @@ protected: } virtual void CharacterData(const XML_Char *s, int len) { + const auto ¤t = m_path.back(); std::string str = trimstring(s, len); - switch (m_path.back()[0]) { + switch (current[0]) { case 'c': - if (!m_path.back().compare("controlURL")) + if (!current.compare("controlURL")) m_tservice.controlURL = std::move(str); break; case 'd': - if (!m_path.back().compare("deviceType")) + if (!current.compare("deviceType")) m_device.deviceType = std::move(str); break; case 'e': - if (!m_path.back().compare("eventSubURL")) + if (!current.compare("eventSubURL")) m_tservice.eventSubURL = std::move(str); break; case 'f': - if (!m_path.back().compare("friendlyName")) + if (!current.compare("friendlyName")) m_device.friendlyName = std::move(str); break; case 'm': - if (!m_path.back().compare("manufacturer")) + if (!current.compare("manufacturer")) m_device.manufacturer = std::move(str); - else if (!m_path.back().compare("modelName")) + else if (!current.compare("modelName")) m_device.modelName = std::move(str); break; case 's': - if (!m_path.back().compare("serviceType")) + if (!current.compare("serviceType")) m_tservice.serviceType = std::move(str); - else if (!m_path.back().compare("serviceId")) + else if (!current.compare("serviceId")) m_tservice.serviceId = std::move(str); case 'S': - if (!m_path.back().compare("SCPDURL")) + if (!current.compare("SCPDURL")) m_tservice.SCPDURL = std::move(str); break; case 'U': - if (!m_path.back().compare("UDN")) + if (!current.compare("UDN")) m_device.UDN = std::move(str); - else if (!m_path.back().compare("URLBase")) + else if (!current.compare("URLBase")) m_device.URLBase = std::move(str); break; } |