diff options
author | Max Kellermann <max@musicpd.org> | 2017-05-08 14:44:49 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-05-08 14:44:49 +0200 |
commit | 71f0ed8b7499011b53f90998ebfbd3250fd80948 (patch) | |
tree | e9c2f66fbef231858f46d878864199d46e6ce21c /src/client | |
parent | ac2e4e593d407e41db49fdb9ae2da6bc1557f618 (diff) |
*: add "noexcept" to many, many function prototypes
This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/Client.cxx | 4 | ||||
-rw-r--r-- | src/client/Client.hxx | 6 | ||||
-rw-r--r-- | src/client/ClientMessage.cxx | 4 | ||||
-rw-r--r-- | src/client/ClientMessage.hxx | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/client/Client.cxx b/src/client/Client.cxx index f6defedf9..c52ca77a1 100644 --- a/src/client/Client.cxx +++ b/src/client/Client.cxx @@ -28,7 +28,7 @@ const Domain client_domain("client"); #ifdef ENABLE_DATABASE const Database * -Client::GetDatabase() const +Client::GetDatabase() const noexcept { return partition.instance.GetDatabase(); } @@ -40,7 +40,7 @@ Client::GetDatabaseOrThrow() const } const Storage * -Client::GetStorage() const +Client::GetStorage() const noexcept { return partition.instance.storage; } diff --git a/src/client/Client.hxx b/src/client/Client.hxx index 69492b4ee..24461878e 100644 --- a/src/client/Client.hxx +++ b/src/client/Client.hxx @@ -160,7 +160,7 @@ public: }; gcc_pure - bool IsSubscribed(const char *channel_name) const { + bool IsSubscribed(const char *channel_name) const noexcept { return subscriptions.find(channel_name) != subscriptions.end(); } @@ -186,7 +186,7 @@ public: * Wrapper for Instance::GetDatabase(). */ gcc_pure - const Database *GetDatabase() const; + const Database *GetDatabase() const noexcept; /** * Wrapper for Instance::GetDatabaseOrThrow(). @@ -195,7 +195,7 @@ public: const Database &GetDatabaseOrThrow() const; gcc_pure - const Storage *GetStorage() const; + const Storage *GetStorage() const noexcept; private: /* virtual methods from class BufferedSocket */ diff --git a/src/client/ClientMessage.cxx b/src/client/ClientMessage.cxx index 145f706dd..da45fe643 100644 --- a/src/client/ClientMessage.cxx +++ b/src/client/ClientMessage.cxx @@ -23,14 +23,14 @@ gcc_const static bool -valid_channel_char(const char ch) +valid_channel_char(const char ch) noexcept { return IsAlphaNumericASCII(ch) || ch == '_' || ch == '-' || ch == '.' || ch == ':'; } bool -client_message_valid_channel_name(const char *name) +client_message_valid_channel_name(const char *name) noexcept { do { if (!valid_channel_char(*name)) diff --git a/src/client/ClientMessage.hxx b/src/client/ClientMessage.hxx index aef914dd7..b665cd65e 100644 --- a/src/client/ClientMessage.hxx +++ b/src/client/ClientMessage.hxx @@ -53,6 +53,6 @@ public: gcc_pure bool -client_message_valid_channel_name(const char *name); +client_message_valid_channel_name(const char *name) noexcept; #endif |