Skip to content
Snippets Groups Projects
Commit 6a264d6f authored by Adrien Béraud's avatar Adrien Béraud
Browse files

infohash: constexpr HexMap constructor

parent b0fa19d6
No related branches found
No related tags found
No related merge requests found
...@@ -345,7 +345,7 @@ Hash<N>::getRandom(Rd& rdev) ...@@ -345,7 +345,7 @@ Hash<N>::getRandom(Rd& rdev)
} }
struct alignas(std::max_align_t) HexMap : public std::array<std::array<char, 2>, 256> { struct alignas(std::max_align_t) HexMap : public std::array<std::array<char, 2>, 256> {
HexMap() { constexpr HexMap() : std::array<std::array<char, 2>, 256>() {
for (size_t i = 0; i < size(); i++) { for (size_t i = 0; i < size(); i++) {
auto& e = (*this)[i]; auto& e = (*this)[i];
e[0] = hex_digits[(i >> 4) & 0x0F]; e[0] = hex_digits[(i >> 4) & 0x0F];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment