diff options
author | crupest <crupest@outlook.com> | 2023-12-16 21:16:46 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2023-12-16 21:16:46 +0800 |
commit | 9514626f02d21edef33fa6212aa47fdb3c115fe9 (patch) | |
tree | c3bf22d34d1eedcb90d8c5380f0c8d59dd7b1e80 /src | |
parent | c9555b5649bd1e886f96276eb392d65fffe2eb47 (diff) | |
download | cru-9514626f02d21edef33fa6212aa47fdb3c115fe9.tar.gz cru-9514626f02d21edef33fa6212aa47fdb3c115fe9.tar.bz2 cru-9514626f02d21edef33fa6212aa47fdb3c115fe9.zip |
Optimize exception constructor.
Diffstat (limited to 'src')
-rw-r--r-- | src/common/Exception.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/common/Exception.cpp b/src/common/Exception.cpp index e1e3e128..37fa0038 100644 --- a/src/common/Exception.cpp +++ b/src/common/Exception.cpp @@ -5,8 +5,6 @@ #include <cerrno> namespace cru { -Exception::Exception() {} - Exception::Exception(String message) : message_(std::move(message)) {} Exception::~Exception() {} @@ -28,10 +26,10 @@ void Exception::AppendMessage(std::optional<StringView> additional_message) { if (additional_message) AppendMessage(*additional_message); } -ErrnoException::ErrnoException(const String& message) +ErrnoException::ErrnoException(String message) : ErrnoException(message, errno) {} -ErrnoException::ErrnoException(const String& message, int errno_code) +ErrnoException::ErrnoException(String message, int errno_code) : Exception(Format(u"{}. Errno is {}.", message, errno_code)), errno_code_(errno_code) {} } // namespace cru |