mirror of https://github.com/AxioDL/metaforce.git
hecl/hecl: Remove pointer casts from Hash constructor interface
The interface accepts const void* as the input type, so there's no need to explicitly pointer cast the input data.
This commit is contained in:
parent
e127fed0fd
commit
a7bd496698
|
@ -441,9 +441,9 @@ public:
|
|||
constexpr Hash(const Hash&) noexcept = default;
|
||||
constexpr Hash(Hash&&) noexcept = default;
|
||||
constexpr Hash(uint64_t hashin) noexcept : hash(hashin) {}
|
||||
explicit Hash(const void* buf, size_t len) noexcept : hash(XXH64((uint8_t*)buf, len, 0)) {}
|
||||
explicit Hash(std::string_view str) noexcept : hash(XXH64((uint8_t*)str.data(), str.size(), 0)) {}
|
||||
explicit Hash(std::wstring_view str) noexcept : hash(XXH64((uint8_t*)str.data(), str.size() * 2, 0)) {}
|
||||
explicit Hash(const void* buf, size_t len) noexcept : hash(XXH64(buf, len, 0)) {}
|
||||
explicit Hash(std::string_view str) noexcept : hash(XXH64(str.data(), str.size(), 0)) {}
|
||||
explicit Hash(std::wstring_view str) noexcept : hash(XXH64(str.data(), str.size() * 2, 0)) {}
|
||||
|
||||
constexpr uint32_t val32() const noexcept { return uint32_t(hash) ^ uint32_t(hash >> 32); }
|
||||
constexpr uint64_t val64() const noexcept { return uint64_t(hash); }
|
||||
|
|
Loading…
Reference in New Issue