Merge pull request #9168 from lioncash/ifconst

DataReader: Make use of if constexpr where applicable
This commit is contained in:
Léo Lam 2020-10-20 14:56:24 +02:00 committed by GitHub
commit ce59b026c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -30,7 +30,7 @@ public:
T data;
std::memcpy(&data, &buffer[offset], sizeof(T));
if (swapped)
if constexpr (swapped)
data = Common::FromBigEndian(data);
return data;
@ -47,7 +47,7 @@ public:
template <typename T, bool swapped = false>
DOLPHIN_FORCE_INLINE void Write(T data)
{
if (swapped)
if constexpr (swapped)
data = Common::FromBigEndian(data);
std::memcpy(buffer, &data, sizeof(T));