From a1ced29279b97e1165ff1a8b84bbac2860316e1a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 10 Jan 2014 21:41:48 +0100 Subject: db/upnp: use nullptr-terminated array Reduce bloat. --- src/db/upnp/Directory.cxx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/db/upnp/Directory.cxx b/src/db/upnp/Directory.cxx index 4e6cd838d..50fbb26f5 100644 --- a/src/db/upnp/Directory.cxx +++ b/src/db/upnp/Directory.cxx @@ -34,8 +34,8 @@ static const char *const upnptags[] = { "upnp:genre", "upnp:originalTrackNumber", "upnp:class", + nullptr, }; -static const int nupnptags = sizeof(upnptags) / sizeof(char*); gcc_pure static UPnPDirObject::ItemClass @@ -167,11 +167,9 @@ protected: } break; case 'u': - for (int i = 0; i < nupnptags; i++) { - if (!m_path.back().compare(upnptags[i])) { - m_tobj.m_props[upnptags[i]] += str; - } - } + for (auto i = upnptags; *i != nullptr; ++i) + if (!m_path.back().compare(*i)) + m_tobj.m_props[*i] += str; break; } } -- cgit v1.2.3