mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-05 15:48:51 +00:00
Merge pull request #9168 from lioncash/ifconst
DataReader: Make use of if constexpr where applicable
This commit is contained in:
commit
ce59b026c0
1 changed files with 2 additions and 2 deletions
|
@ -30,7 +30,7 @@ public:
|
||||||
T data;
|
T data;
|
||||||
std::memcpy(&data, &buffer[offset], sizeof(T));
|
std::memcpy(&data, &buffer[offset], sizeof(T));
|
||||||
|
|
||||||
if (swapped)
|
if constexpr (swapped)
|
||||||
data = Common::FromBigEndian(data);
|
data = Common::FromBigEndian(data);
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
|
@ -47,7 +47,7 @@ public:
|
||||||
template <typename T, bool swapped = false>
|
template <typename T, bool swapped = false>
|
||||||
DOLPHIN_FORCE_INLINE void Write(T data)
|
DOLPHIN_FORCE_INLINE void Write(T data)
|
||||||
{
|
{
|
||||||
if (swapped)
|
if constexpr (swapped)
|
||||||
data = Common::FromBigEndian(data);
|
data = Common::FromBigEndian(data);
|
||||||
|
|
||||||
std::memcpy(buffer, &data, sizeof(T));
|
std::memcpy(buffer, &data, sizeof(T));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue