From 06caefaaccefd8ce5c1975b4ed16e3bbf3b20101 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 13 Feb 2024 15:08:11 -0800 Subject: [PATCH] ucstrcmp/eq: remove pointer equality check People don't usually do s == s checks (or s != s for that matter), so having this here implies everyone else gets penalized. Change-Id: I83dda2d36c904517b3c0fffd17b38ecc324811ce Reviewed-by: Thiago Macieira Reviewed-by: Ahmad Samir --- src/corelib/text/qstring.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 0c4cec34644..62f331b927a 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -1350,10 +1350,6 @@ static int ucstrncmp(const char16_t *a, const char *b, size_t l) template static bool ucstreq(const char16_t *a, size_t alen, const Char2 *b) { - if constexpr (std::is_same_v) { - if (a == b) - return true; - } return ucstrncmp(a, b, alen) == 0; } @@ -1361,10 +1357,6 @@ static bool ucstreq(const char16_t *a, size_t alen, const Char2 *b) template static int ucstrcmp(const char16_t *a, size_t alen, const Char2 *b, size_t blen) { - if constexpr (std::is_same_v) { - if (a == b && alen == blen) - return 0; - } const size_t l = qMin(alen, blen); int cmp = ucstrncmp(a, b, l); return cmp ? cmp : qt_lencmp(alen, blen);