aboutsummaryrefslogtreecommitdiffstats
path: root/src/db
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-01-22 21:47:34 +0100
committerMax Kellermann <max@duempel.org>2014-01-22 21:47:34 +0100
commita0bee9fa0a821f1654d1c4c306441bd8526a0a5b (patch)
treefc3e460dbfd4277fcc261e2cd4670ed3e74be78d /src/db
parent0defd927f3a483de56e0d768345bce9e7266be24 (diff)
downloadmpd-a0bee9fa0a821f1654d1c4c306441bd8526a0a5b.tar.gz
mpd-a0bee9fa0a821f1654d1c4c306441bd8526a0a5b.tar.xz
mpd-a0bee9fa0a821f1654d1c4c306441bd8526a0a5b.zip
db/upnp/Discovery: eliminate two strlen() calls
Diffstat (limited to 'src/db')
-rw-r--r--src/db/upnp/Discovery.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/db/upnp/Discovery.cxx b/src/db/upnp/Discovery.cxx
index 085e5c336..082e470ad 100644
--- a/src/db/upnp/Discovery.cxx
+++ b/src/db/upnp/Discovery.cxx
@@ -30,7 +30,7 @@
#include <string.h>
// The service type string we are looking for.
-static const char *const ContentDirectorySType = "urn:schemas-upnp-org:service:ContentDirectory:1";
+static constexpr char ContentDirectorySType[] = "urn:schemas-upnp-org:service:ContentDirectory:1";
// We don't include a version in comparisons, as we are satisfied with
// version 1
@@ -38,18 +38,18 @@ gcc_pure
static bool
isCDService(const char *st)
{
- const size_t sz = strlen(ContentDirectorySType) - 2;
+ constexpr size_t sz = sizeof(ContentDirectorySType) - 3;
return memcmp(ContentDirectorySType, st, sz) == 0;
}
// The type of device we're asking for in search
-static const char *const MediaServerDType = "urn:schemas-upnp-org:device:MediaServer:1";
+static constexpr char MediaServerDType[] = "urn:schemas-upnp-org:device:MediaServer:1";
gcc_pure
static bool
isMSDevice(const char *st)
{
- const size_t sz = strlen(MediaServerDType) - 2;
+ constexpr size_t sz = sizeof(MediaServerDType) - 3;
return memcmp(MediaServerDType, st, sz) == 0;
}