Skip to content
Snippets Groups Projects
Commit e259cb08 authored by Sébastien Blin's avatar Sébastien Blin Committed by Adrien Béraud
Browse files

infohash: remove optimization due to weird warnings

Current operator== creates a very weird warning about using an
uninitialized value (no warning without the reinterpret_cast).
parent 08f9b424
No related branches found
No related tags found
No related merge requests found
......@@ -103,11 +103,8 @@ public:
static constexpr inline Hash zero() noexcept { return Hash{}; }
bool operator==(const Hash& h) const {
auto a = reinterpret_cast<const uint32_t*>(data_.data());
auto b = reinterpret_cast<const uint32_t*>(h.data_.data());
constexpr unsigned n = N / sizeof(uint32_t);
for (unsigned i=0; i < n; i++)
if (a[i] != b[i])
for (unsigned i=0; i < N; i++)
if (data_[i] != h.data_[i])
return false;
return true;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment