Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #9168 from lioncash/ifconst
DataReader: Make use of if constexpr where applicable
  • Loading branch information
leoetlino committed Oct 20, 2020
2 parents 299adf5 + 7bc2bbc commit ce59b02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/Core/VideoCommon/DataReader.h
Expand Up @@ -30,7 +30,7 @@ class DataReader
T data;
std::memcpy(&data, &buffer[offset], sizeof(T));

if (swapped)
if constexpr (swapped)
data = Common::FromBigEndian(data);

return data;
Expand All @@ -47,7 +47,7 @@ class DataReader
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));
Expand Down

0 comments on commit ce59b02

Please sign in to comment.