summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2024-04-13 12:12:09 -0700
committerThiago Macieira <thiago.macieira@intel.com>2024-04-17 11:41:36 -0700
commita7b9ec7f6f465ce0d90edfe7154a4837b1fb9c00 (patch)
treebe92171aefad072ee1c2c20c08eb34134b71e204 /src
parent85d74a417e16d61549c2b916c431894a80fdcabf (diff)
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 <ivan.solovev@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/serialization/qcborvalue.cpp5
1 files changed, 0 insertions, 5 deletions
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;