teeny tiny opt

This commit is contained in:
SimoneN64
2023-10-22 20:07:45 +02:00
parent ccd889e1da
commit 33ac97ff06

View File

@@ -6,7 +6,7 @@
namespace Util { namespace Util {
template<typename T> template<typename T>
FORCE_INLINE T ReadAccess(u8 *data, u32 index) { static FORCE_INLINE T ReadAccess(u8 *data, u32 index) {
if constexpr (sizeof(T) == 8) { if constexpr (sizeof(T) == 8) {
u32 hi = *reinterpret_cast<u32*>(&data[index + 0]); u32 hi = *reinterpret_cast<u32*>(&data[index + 0]);
u32 lo = *reinterpret_cast<u32*>(&data[index + 4]); u32 lo = *reinterpret_cast<u32*>(&data[index + 4]);
@@ -18,7 +18,7 @@ FORCE_INLINE T ReadAccess(u8 *data, u32 index) {
} }
template<typename T> template<typename T>
FORCE_INLINE void WriteAccess(u8 *data, u32 index, T val) { static FORCE_INLINE void WriteAccess(u8 *data, u32 index, T val) {
if constexpr (sizeof(T) == 8) { if constexpr (sizeof(T) == 8) {
u32 hi = val >> 32; u32 hi = val >> 32;
u32 lo = val; u32 lo = val;