Remove duplicate check in utf endian detection

This was excessive paranoia.

Task-number: QTBUG-20482
Change-Id: Ia0c76651773e12f25ec5d62675d6f317b8d2df13
Reviewed-on: http://codereview.qt-project.org/6045
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Kent Hansen 2011-10-05 11:53:06 +02:00 committed by Qt by Nokia
parent 8f114af67b
commit 11f80c022f

View File

@ -467,7 +467,6 @@ QString QUtf32::convertToUnicode(const char *chars, int len, QTextCodec::Convert
tuple[num++] = *chars++; tuple[num++] = *chars++;
if (num == 4) { if (num == 4) {
if (!headerdone) { if (!headerdone) {
if (endian == DetectEndianness) {
if (endian == DetectEndianness) { if (endian == DetectEndianness) {
if (tuple[0] == 0xff && tuple[1] == 0xfe && tuple[2] == 0 && tuple[3] == 0 && endian != BigEndianness) { if (tuple[0] == 0xff && tuple[1] == 0xfe && tuple[2] == 0 && tuple[3] == 0 && endian != BigEndianness) {
endian = LittleEndianness; endian = LittleEndianness;
@ -482,7 +481,6 @@ QString QUtf32::convertToUnicode(const char *chars, int len, QTextCodec::Convert
} else { } else {
endian = LittleEndianness; endian = LittleEndianness;
} }
}
} else if (((endian == BigEndianness) ? qFromBigEndian<quint32>(tuple) : qFromLittleEndian<quint32>(tuple)) == QChar::ByteOrderMark) { } else if (((endian == BigEndianness) ? qFromBigEndian<quint32>(tuple) : qFromLittleEndian<quint32>(tuple)) == QChar::ByteOrderMark) {
num = 0; num = 0;
continue; continue;