summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qbytearraymatcher.h
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-01-21 14:29:27 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-01-21 20:45:11 +0000
commite1654aeb2e7fa282af045496c4903b06d2893e21 (patch)
treed09bf24891eb9c587c35a279f2387bc4fc4f0af1 /src/corelib/text/qbytearraymatcher.h
parent6db1284de91b9a5112e602fd59a3826588f0fce9 (diff)
QStaticByteArrayMatcher: add a useful comment
Took me a few seconds to figure this out, and I'm the author of the class, so leave a comment for my future self (and anyone else). Pick-to: 6.3 6.2 5.15 Change-Id: I65a7aa6f8abf9d671f7d9ba45400f19e0f46728f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Diffstat (limited to 'src/corelib/text/qbytearraymatcher.h')
-rw-r--r--src/corelib/text/qbytearraymatcher.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/text/qbytearraymatcher.h b/src/corelib/text/qbytearraymatcher.h
index d9ea638500..2a65a257ee 100644
--- a/src/corelib/text/qbytearraymatcher.h
+++ b/src/corelib/text/qbytearraymatcher.h
@@ -147,6 +147,7 @@ template <uint N>
class QStaticByteArrayMatcher : QStaticByteArrayMatcherBase
{
char m_pattern[N];
+ // N includes the terminating '\0'!
static_assert(N > 2, "QStaticByteArrayMatcher makes no sense for finding a single-char pattern");
public:
explicit constexpr QStaticByteArrayMatcher(const char (&patternToMatch)[N]) noexcept