infohash: constexpr HexMap constructor

This commit is contained in:
Adrien Béraud committed 2025-03-24 23:29:32 -04:00
1 parent b0fa19d6f8
commit 6a264d6f73
1 file changed
+2 -2
+2 -2
View File
@@ -345,8 +345,8 @@ Hash<N>::getRandom(Rd& rdev)
}
struct alignas(std::max_align_t) HexMap : public std::array<std::array<char, 2>, 256> {
HexMap() {
for (size_t i=0; i<size(); i++) {
constexpr HexMap() : std::array<std::array<char, 2>, 256>() {
for (size_t i = 0; i < size(); i++) {
auto& e = (*this)[i];
e[0] = hex_digits[(i >> 4) & 0x0F];
e[1] = hex_digits[i & 0x0F];