aboutsummaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-10 21:41:48 +0100
committerMax Kellermann <max@duempel.org>2014-01-10 22:58:23 +0100
commita1ced29279b97e1165ff1a8b84bbac2860316e1a (patch)
tree2c8f83af81ba1990366ef25e98bcd947e8676850 /src/db
parent791d6c13366ac5cf43dd1d22dfa9da38f9300068 (diff)
downloadmpd-a1ced29279b97e1165ff1a8b84bbac2860316e1a.tar.gz
mpd-a1ced29279b97e1165ff1a8b84bbac2860316e1a.tar.xz
mpd-a1ced29279b97e1165ff1a8b84bbac2860316e1a.zip
db/upnp: use nullptr-terminated array
Reduce bloat.
Diffstat (limited to 'src/db')
-rw-r--r--src/db/upnp/Directory.cxx10
1 files changed, 4 insertions, 6 deletions
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;
}
}