diff --git a/src/data/fitparser.cpp b/src/data/fitparser.cpp index 3dd4f0cb..057e03c9 100644 --- a/src/data/fitparser.cpp +++ b/src/data/fitparser.cpp @@ -87,13 +87,10 @@ template bool FITParser::readValue(CTX &ctx, T &val) ctx.len -= sizeof(T); - if (sizeof(T) > 1) { - if (ctx.endian) - val = qFromBigEndian(data); - else - val = qFromLittleEndian(data); - } else - val = data; + if (ctx.endian) + val = qFromBigEndian(data); + else + val = qFromLittleEndian(data); return true; } diff --git a/src/map/IMG/img.cpp b/src/map/IMG/img.cpp index a2aa18ba..30623003 100644 --- a/src/map/IMG/img.cpp +++ b/src/map/IMG/img.cpp @@ -227,10 +227,7 @@ template bool IMG::readValue(T &val) if (read((char*)&data, sizeof(T)) < (qint64)sizeof(T)) return false; - if (sizeof(T) > 1) - val = qFromLittleEndian(data); - else - val = data; + val = qFromLittleEndian(data); return true; } diff --git a/src/map/jnxmap.cpp b/src/map/jnxmap.cpp index 5faf5190..a96aeaf6 100644 --- a/src/map/jnxmap.cpp +++ b/src/map/jnxmap.cpp @@ -34,10 +34,7 @@ template bool JNXMap::readValue(T &val) if (_file.read((char*)&data, sizeof(T)) < (qint64)sizeof(T)) return false; - if (sizeof(T) > 1) - val = qFromLittleEndian(data); - else - val = data; + val = qFromLittleEndian(data); return true; } diff --git a/src/map/ozf.cpp b/src/map/ozf.cpp index 47dfa635..c0654810 100644 --- a/src/map/ozf.cpp +++ b/src/map/ozf.cpp @@ -32,10 +32,7 @@ template bool OZF::readValue(T &val) if (_decrypt) decrypt(&data, sizeof(T), _key); - if (sizeof(T) > 1) - val = qFromLittleEndian(data); - else - val = data; + val = qFromLittleEndian(data); return true; }