mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-31 09:33:47 +00:00
refactor(Core): apply clang-tidy modernize-use-nodiscard (#3835)
This commit is contained in:
@@ -53,27 +53,27 @@ public:
|
||||
offset = r.offset;
|
||||
return *this;
|
||||
}
|
||||
float getFloat(size_t field) const
|
||||
[[nodiscard]] float getFloat(size_t field) const
|
||||
{
|
||||
assert(field < file.fieldCount);
|
||||
return *reinterpret_cast<float*>(offset + field * 4);
|
||||
}
|
||||
unsigned int getUInt(size_t field) const
|
||||
[[nodiscard]] unsigned int getUInt(size_t field) const
|
||||
{
|
||||
assert(field < file.fieldCount);
|
||||
return *reinterpret_cast<unsigned int*>(offset + (field * 4));
|
||||
}
|
||||
int getInt(size_t field) const
|
||||
[[nodiscard]] int getInt(size_t field) const
|
||||
{
|
||||
assert(field < file.fieldCount);
|
||||
return *reinterpret_cast<int*>(offset + field * 4);
|
||||
}
|
||||
unsigned char getByte(size_t ofs) const
|
||||
[[nodiscard]] unsigned char getByte(size_t ofs) const
|
||||
{
|
||||
assert(ofs < file.recordSize);
|
||||
return *reinterpret_cast<unsigned char*>(offset + ofs);
|
||||
}
|
||||
const char* getString(size_t field) const
|
||||
[[nodiscard]] const char* getString(size_t field) const
|
||||
{
|
||||
assert(field < file.fieldCount);
|
||||
size_t stringOffset = getUInt(field);
|
||||
@@ -129,8 +129,8 @@ public:
|
||||
/// Get begin iterator over records
|
||||
Iterator end();
|
||||
/// Trivial
|
||||
size_t getRecordCount() const { return recordCount;}
|
||||
size_t getFieldCount() const { return fieldCount; }
|
||||
[[nodiscard]] size_t getRecordCount() const { return recordCount;}
|
||||
[[nodiscard]] size_t getFieldCount() const { return fieldCount; }
|
||||
|
||||
private:
|
||||
std::string filename;
|
||||
|
||||
@@ -85,12 +85,12 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
float lengthSquared() const
|
||||
[[nodiscard]] float lengthSquared() const
|
||||
{
|
||||
return x * x + y * y + z * z;
|
||||
}
|
||||
|
||||
float length() const
|
||||
[[nodiscard]] float length() const
|
||||
{
|
||||
return sqrt(x * x + y * y + z * z);
|
||||
}
|
||||
@@ -192,12 +192,12 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
float lengthSquared() const
|
||||
[[nodiscard]] float lengthSquared() const
|
||||
{
|
||||
return x * x + y * y;
|
||||
}
|
||||
|
||||
float length() const
|
||||
[[nodiscard]] float length() const
|
||||
{
|
||||
return sqrt(x * x + y * y);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user