From f757dfdc4fa34664362e201c7f7a051ae61929b8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 25 Nov 2023 22:56:49 +0100 Subject: [PATCH] SongLoader: add `noexcept` --- src/SongLoader.cxx | 2 +- src/SongLoader.hxx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/SongLoader.cxx b/src/SongLoader.cxx index 1c5bd6016..303575db5 100644 --- a/src/SongLoader.cxx +++ b/src/SongLoader.cxx @@ -14,7 +14,7 @@ #ifdef ENABLE_DATABASE -SongLoader::SongLoader(const Client &_client) +SongLoader::SongLoader(const Client &_client) noexcept :client(&_client), db(_client.GetDatabase()), storage(_client.GetStorage()) {} diff --git a/src/SongLoader.hxx b/src/SongLoader.hxx index 0087d4530..eb4d18516 100644 --- a/src/SongLoader.hxx +++ b/src/SongLoader.hxx @@ -31,21 +31,21 @@ class SongLoader { public: #ifdef ENABLE_DATABASE - explicit SongLoader(const Client &_client); - SongLoader(const Database *_db, const Storage *_storage) + explicit SongLoader(const Client &_client) noexcept; + SongLoader(const Database *_db, const Storage *_storage) noexcept :client(nullptr), db(_db), storage(_storage) {} SongLoader(const Client &_client, const Database *_db, - const Storage *_storage) + const Storage *_storage) noexcept :client(&_client), db(_db), storage(_storage) {} #else - explicit SongLoader(const Client &_client) + explicit SongLoader(const Client &_client) noexcept :client(&_client) {} - explicit SongLoader(std::nullptr_t, std::nullptr_t) + explicit SongLoader(std::nullptr_t, std::nullptr_t) noexcept :client(nullptr) {} #endif #ifdef ENABLE_DATABASE - const Storage *GetStorage() const { + const Storage *GetStorage() const noexcept { return storage; } #endif