summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tools/moc/utils.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/tools/moc/utils.h b/src/tools/moc/utils.h
index 358780a33d7..cb118fab38b 100644
--- a/src/tools/moc/utils.h
+++ b/src/tools/moc/utils.h
@@ -6,6 +6,8 @@
#include <QtCore/qglobal.h>
+#include <algorithm>
+
QT_BEGIN_NAMESPACE
inline bool is_whitespace(char s)
@@ -35,16 +37,11 @@ inline bool is_ident_char(char s)
);
}
-inline bool is_identifier(const char *s, int len)
+inline bool is_identifier(const char *s, qsizetype len)
{
if (len < 1)
return false;
- if (!is_ident_start(*s))
- return false;
- for (int i = 1; i < len; ++i)
- if (!is_ident_char(s[i]))
- return false;
- return true;
+ return std::all_of(s, s + len, is_ident_char);
}
inline bool is_digit_char(char s)