summaryrefslogtreecommitdiffstats
path: root/header.LGPL3-COMM
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2020-07-19 10:55:55 -0700
committerThiago Macieira <thiago.macieira@intel.com>2020-07-30 20:29:23 -0700
commit61ccfefb25d61da95a1a1cdf0313da1448dc23c6 (patch)
treeeb69b2f3ed3c4ad7e76738220820602d1e9815c7 /header.LGPL3-COMM
parentcaa40f57d4d9ccf22d728e486148d2be6b29e249 (diff)
Fix warning in QStringView::compare(QChar) on qsizetype->int
size() - 1 is converted to int as the result, but size() is a qsizetype and could be bigger than INT_MAX. So rewrite to not depend on the cast. This was introduced on b2f79cceb11dfd15ac9eea631bc18ad6b036eb91. I could have replaced size() - 1 with int(size() > 1) - 1, but that's even more complex. To simplify, I split the function in two while retaining the C++11 constexpr requirements. Bonus: removes the use of the ambiguously-named "empty()" function that looks like a verb. Fixes: QTBUG-85665 Pick-to: 5.15 Change-Id: Ieffc3453b88c4517a1dbfffd162338fdb084a376 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'header.LGPL3-COMM')
0 files changed, 0 insertions, 0 deletions