aboutsummaryrefslogtreecommitdiff
path: root/sibs/SafeDeserializer.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-05-16 00:21:24 +0200
committerdec05eba <0xdec05eba@gmail.com>2018-05-16 00:21:27 +0200
commit8315157349bc1a98613bcc9c6e3a6bec532b4691 (patch)
tree714b129d9e3726ba348b3b285e092de332e585b8 /sibs/SafeDeserializer.hpp
parente85a6b1e7cd8da631fd181d95e4bed7bd95f3386 (diff)
Optimize for little endian instead of big endian1.0.0
Diffstat (limited to 'sibs/SafeDeserializer.hpp')
-rw-r--r--sibs/SafeDeserializer.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sibs/SafeDeserializer.hpp b/sibs/SafeDeserializer.hpp
index 7ef6b3f..0110920 100644
--- a/sibs/SafeDeserializer.hpp
+++ b/sibs/SafeDeserializer.hpp
@@ -38,7 +38,7 @@ namespace sibs
verifyExtractSize(typeSize);
size -= typeSize;
T result;
- #ifdef LITTLE_ENDIAN
+ #if BYTE_ORDER == BIG_ENDIAN
switch(typeSize)
{
case 1:
@@ -63,7 +63,7 @@ namespace sibs
}
}
#else
- memcpy(&result, data, typeSize);
+ result = *(T*)data;
#endif
data += typeSize;
return result;