From 449f6d5f6116af98df67d372e1a038062fac4b9b Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 15 Dec 2021 20:23:27 -0300 Subject: [PATCH] QString: replace an #if with if Pick-to: 6.3 6.2 Change-Id: Ib42b3adc93bf4d43bd55fffd16c111291d1e8ddd Reviewed-by: Marc Mutz --- src/corelib/text/qstring.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 4d6e4386f4..940810e8af 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2021 The Qt Company Ltd. -** Copyright (C) 2020 Intel Corporation. +** Copyright (C) 2022 Intel Corporation. ** Copyright (C) 2019 Mail.ru Group. ** Contact: https://www.qt.io/licensing/ ** @@ -511,11 +511,9 @@ bool qt_is_ascii(const char *&ptr, const char *end) noexcept while (ptr + 4 <= end) { quint32 data = qFromUnaligned(ptr); if (data &= 0x80808080U) { -#if Q_BYTE_ORDER == Q_BIG_ENDIAN - uint idx = qCountLeadingZeroBits(data); -#else - uint idx = qCountTrailingZeroBits(data); -#endif + uint idx = QSysInfo::ByteOrder == QSysInfo::BigEndian + ? qCountLeadingZeroBits(data) + : qCountTrailingZeroBits(data); ptr += idx / 8; return false; }