mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-28 16:16:27 +00:00
refactor(Core): apply clang-tidy modernize-use-nodiscard (#3835)
This commit is contained in:
@@ -24,7 +24,7 @@ class ByteBufferException : public std::exception
|
||||
public:
|
||||
~ByteBufferException() throw() override { }
|
||||
|
||||
char const* what() const throw() override { return msg_.c_str(); }
|
||||
[[nodiscard]] char const* what() const throw() override { return msg_.c_str(); }
|
||||
|
||||
protected:
|
||||
std::string& message() throw() { return msg_; }
|
||||
@@ -277,7 +277,7 @@ public:
|
||||
return _storage[pos];
|
||||
}
|
||||
|
||||
size_t rpos() const { return _rpos; }
|
||||
[[nodiscard]] size_t rpos() const { return _rpos; }
|
||||
|
||||
size_t rpos(size_t rpos_)
|
||||
{
|
||||
@@ -290,7 +290,7 @@ public:
|
||||
_rpos = wpos();
|
||||
}
|
||||
|
||||
size_t wpos() const { return _wpos; }
|
||||
[[nodiscard]] size_t wpos() const { return _wpos; }
|
||||
|
||||
size_t wpos(size_t wpos_)
|
||||
{
|
||||
@@ -315,7 +315,7 @@ public:
|
||||
return r;
|
||||
}
|
||||
|
||||
template <typename T> T read(size_t pos) const
|
||||
template <typename T> [[nodiscard]] [[nodiscard]] [[nodiscard]] [[nodiscard]] [[nodiscard]] [[nodiscard]] [[nodiscard]] [[nodiscard]] [[nodiscard]] [[nodiscard]] [[nodiscard]] T read(size_t pos) const
|
||||
{
|
||||
if (pos + sizeof(T) > size())
|
||||
throw ByteBufferPositionException(false, pos, sizeof(T), size());
|
||||
@@ -385,15 +385,15 @@ public:
|
||||
return &_storage[0];
|
||||
}
|
||||
|
||||
const uint8* contents() const
|
||||
[[nodiscard]] const uint8* contents() const
|
||||
{
|
||||
if (_storage.empty())
|
||||
throw ByteBufferException();
|
||||
return &_storage[0];
|
||||
}
|
||||
|
||||
size_t size() const { return _storage.size(); }
|
||||
bool empty() const { return _storage.empty(); }
|
||||
[[nodiscard]] size_t size() const { return _storage.size(); }
|
||||
[[nodiscard]] bool empty() const { return _storage.empty(); }
|
||||
|
||||
void resize(size_t newsize)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user