Commit a1ced292 authored by Max Kellermann's avatar Max Kellermann

db/upnp: use nullptr-terminated array

Reduce bloat.
parent 791d6c13
...@@ -34,8 +34,8 @@ static const char *const upnptags[] = { ...@@ -34,8 +34,8 @@ static const char *const upnptags[] = {
"upnp:genre", "upnp:genre",
"upnp:originalTrackNumber", "upnp:originalTrackNumber",
"upnp:class", "upnp:class",
nullptr,
}; };
static const int nupnptags = sizeof(upnptags) / sizeof(char*);
gcc_pure gcc_pure
static UPnPDirObject::ItemClass static UPnPDirObject::ItemClass
...@@ -167,11 +167,9 @@ protected: ...@@ -167,11 +167,9 @@ protected:
} }
break; break;
case 'u': case 'u':
for (int i = 0; i < nupnptags; i++) { for (auto i = upnptags; *i != nullptr; ++i)
if (!m_path.back().compare(upnptags[i])) { if (!m_path.back().compare(*i))
m_tobj.m_props[upnptags[i]] += str; m_tobj.m_props[*i] += str;
}
}
break; break;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment