BAN: Remove endianness functions from Math

There is now a Endianness.h for these. The functions were super slow.
This commit is contained in:
Bananymous 2023-09-29 19:38:07 +03:00
parent 94ce2c97be
commit eb5c6cf736
1 changed files with 0 additions and 18 deletions

View File

@ -102,22 +102,4 @@ namespace BAN::Math
return result;
}
template<integral T>
inline constexpr T little_endian_to_host(const uint8_t* bytes)
{
T result = 0;
for (size_t i = 0; i < sizeof(T); i++)
result |= (T)bytes[i] << (i * 8);
return result;
}
template<integral T>
inline constexpr T big_endian_to_host(const uint8_t* bytes)
{
T result = 0;
for (size_t i = 0; i < sizeof(T); i++)
result |= (T)bytes[i] << (8 * (sizeof(T) - i - 1));
return result;
}
}