summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-02-23 15:35:31 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-03-04 08:03:51 +0100
commit04cc5befd67e78ed90f4632532e8ca1dfd43675b (patch)
tree8fcd269c94a729f40c65c57b41e99a6374baea93 /src
parentb72d7931f1b54b40883737322b05cdab35a312fa (diff)
Backport QtMiscUtils::toAsciiLower() from dev
A partial cherry-pick of 5f338040f4ecbf6404ea5610ec19adfd9ca71c35, it contains only the new helper function, making it available for cherry-picking 955106c4fbc3769c646beb99ed91dadff14ec2d2. Pick-to: 6.2 Change-Id: Iea89ac12cf2f0fcf94efba69ba94f92f4e3e0fed Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qtools_p.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/tools/qtools_p.h b/src/corelib/tools/qtools_p.h
index 8854ae8c48..9d4a3ffe60 100644
--- a/src/corelib/tools/qtools_p.h
+++ b/src/corelib/tools/qtools_p.h
@@ -84,6 +84,11 @@ constexpr inline int fromOct(uint c) noexcept
{
return ((c >= '0') && (c <= '7')) ? int(c - '0') : -1;
}
+
+constexpr inline char toAsciiLower(char ch) noexcept
+{
+ return (ch >= 'A' && ch <= 'Z') ? ch - 'A' + 'a' : ch;
+}
}
// We typically need an extra bit for qNextPowerOfTwo when determining the next allocation size.