From a7b9ec7f6f465ce0d90edfe7154a4837b1fb9c00 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 13 Apr 2024 12:12:09 -0700 Subject: CBOR: Remove dead code: len[12] are not used with UTF-16 The lengths are only needed to check if one of the two strings is empty and in the direct 8-bit comparisons with memcmp(). So we don't need this division by 2, which was here since the initial commit. Amends d4c7da9a07dc1434692fe08a61ba22c794574c4f. Pick-to: 6.7 Change-Id: Ie28eadac333c4bcd8c08fffd17c5ecbce564ccd1 Reviewed-by: Ivan Solovev --- src/corelib/serialization/qcborvalue.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/corelib/serialization/qcborvalue.cpp b/src/corelib/serialization/qcborvalue.cpp index 34c6d2b160..cd0b842111 100644 --- a/src/corelib/serialization/qcborvalue.cpp +++ b/src/corelib/serialization/qcborvalue.cpp @@ -1275,11 +1275,6 @@ static int compareElementRecursive(const QCborContainerPrivate *c1, const Elemen if (b1 || b2) { auto len1 = b1 ? b1->len : 0; auto len2 = b2 ? b2->len : 0; - - if (e1.flags & Element::StringIsUtf16) - len1 /= 2; - if (e2.flags & Element::StringIsUtf16) - len2 /= 2; if (len1 == 0 || len2 == 0) return len1 < len2 ? -1 : len1 == len2 ? 0 : 1; -- cgit v1.2.3