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>
This commit is contained in:
parent
85d74a417e
commit
a7b9ec7f6f
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user