From 3c0370bd3d0ee83b84ea7c1cc579be51768df183 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 28 Jan 2010 17:41:13 +0100 Subject: remove pointless conditionals we already know that (endian == DetectEndianness) - we tested it 1 resp 3 lines above ... Reviewed-By: denis --- src/corelib/codecs/qutfcodec.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index f88fa8d..7655c51 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -328,10 +328,9 @@ QString QUtf16::convertToUnicode(const char *chars, int len, QTextCodec::Convert if (!headerdone) { headerdone = true; if (endian == DetectEndianness) { - if (ch == QChar::ByteOrderSwapped && endian != BigEndianness) { + if (ch == QChar::ByteOrderSwapped) { endian = LittleEndianness; - } else if (ch == QChar::ByteOrderMark && endian != LittleEndianness) { - // ignore BOM + } else if (ch == QChar::ByteOrderMark) { endian = BigEndianness; } else { if (QSysInfo::ByteOrder == QSysInfo::BigEndian) { -- cgit v0.12