OSDN Git Service

remove unused qIsAlnum() function
authorIvailo Monev <xakepa10@gmail.com>
Sun, 22 Nov 2020 03:19:51 +0000 (03:19 +0000)
committerIvailo Monev <xakepa10@gmail.com>
Sun, 22 Nov 2020 03:19:51 +0000 (03:19 +0000)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/tools/qlocale_tools.cpp
src/core/tools/qlocale_tools_p.h

index 0000b31..8f4efe5 100644 (file)
 
 QT_BEGIN_NAMESPACE
 
-QString qulltoa(qulonglong l, int base, const QChar _zero)
+QString qulltoa(qulonglong l, int base, const QChar zero)
 {
     ushort buff[65]; // length of MAX_ULLONG in base 2
     ushort *p = buff + 65;
 
-    if (base != 10 || _zero.unicode() == '0') {
+    if (base != 10 || zero.unicode() == '0') {
         while (l != 0) {
             int c = l % base;
 
@@ -76,7 +76,7 @@ QString qulltoa(qulonglong l, int base, const QChar _zero)
         while (l != 0) {
             int c = l % base;
 
-            *(--p) = _zero.unicode() + c;
+            *(--p) = zero.unicode() + c;
 
             l /= base;
         }
index f3092c1..9217f39 100644 (file)
@@ -52,7 +52,7 @@
 
 QT_BEGIN_NAMESPACE
 
-QString qulltoa(qulonglong l, int base, const QChar _zero);
+QString qulltoa(qulonglong l, int base, const QChar zero);
 QString qlltoa(qlonglong l, int base, const QChar zero);
 
 enum PrecisionMode {
@@ -79,25 +79,19 @@ static inline bool qIsZero(double d)
 
 static inline bool qIsUpper(char ch)
 {
-    return ch >= 'A' && ch <= 'Z';
+    return (ch >= 'A' && ch <= 'Z');
 }
 
 static inline bool qIsDigit(char ch)
 {
-    return ch >= '0' && ch <= '9';
+    return (ch >= '0' && ch <= '9');
 }
 
 static inline char qToLower(char ch)
 {
     if (ch >= 'A' && ch <= 'Z')
-        return ch - 'A' + 'a';
-    else
-        return ch;
-}
-
-static inline bool qIsAlnum(char c)
-{
-    return (c >= '0' && c <= '9') || ((c | 0x20) >= 'a' && (c | 0x20) <= 'z');
+        return (ch - 'A' + 'a');
+    return ch;
 }
 
 // Removes thousand-group separators in "C" locale.