diff options
author | Max Kellermann <max@duempel.org> | 2013-01-03 11:31:32 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-03 17:49:47 +0100 |
commit | d919f8d50ab32a94b8965330297985cd14c45a42 (patch) | |
tree | 238445dc46c7206af0859b3f075f9bd0a4026648 /src/ClientInternal.hxx | |
parent | d67aa7c19dfaf5c39b49dc8dfc486b4e99f31db1 (diff) | |
download | mpd-d919f8d50ab32a94b8965330297985cd14c45a42.tar.gz mpd-d919f8d50ab32a94b8965330297985cd14c45a42.tar.xz mpd-d919f8d50ab32a94b8965330297985cd14c45a42.zip |
ClientInternal: use std::set for subscriptions
Diffstat (limited to 'src/ClientInternal.hxx')
-rw-r--r-- | src/ClientInternal.hxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ClientInternal.hxx b/src/ClientInternal.hxx index ac50a3e99..be423bb24 100644 --- a/src/ClientInternal.hxx +++ b/src/ClientInternal.hxx @@ -24,6 +24,9 @@ #include "ClientMessage.hxx" #include "command.h" +#include <set> +#include <string> + #include <glib.h> #undef G_LOG_DOMAIN @@ -82,7 +85,7 @@ public: /** * A list of channel names this client is subscribed to. */ - GSList *subscriptions; + std::set<std::string> subscriptions; /** * The number of subscriptions in #subscriptions. Used to @@ -100,6 +103,11 @@ public: * The number of messages in #messages. */ unsigned num_messages; + + gcc_pure + bool IsSubscribed(const char *channel_name) const { + return subscriptions.find(channel_name) != subscriptions.end(); + } }; extern unsigned int client_max_connections; |