diff options
Diffstat (limited to 'src/corelib/tools/qregexp.cpp')
-rw-r--r-- | src/corelib/tools/qregexp.cpp | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp index cd8c393d51..5aa9d54843 100644 --- a/src/corelib/tools/qregexp.cpp +++ b/src/corelib/tools/qregexp.cpp @@ -38,6 +38,7 @@ #include "qcache.h" #include "qdatastream.h" #include "qdebug.h" +#include "qhashfunctions.h" #include "qlist.h" #include "qmap.h" #include "qmutex.h" @@ -882,6 +883,15 @@ static bool operator==(const QRegExpEngineKey &key1, const QRegExpEngineKey &key && key1.cs == key2.cs; } +static uint qHash(const QRegExpEngineKey &key, uint seed = 0) Q_DECL_NOTHROW +{ + QtPrivate::QHashCombine hash; + seed = hash(seed, key.pattern); + seed = hash(seed, key.patternSyntax); + seed = hash(seed, key.cs); + return seed; +} + class QRegExpEngine; //Q_DECLARE_TYPEINFO(QVector<int>, Q_MOVABLE_TYPE); @@ -3807,11 +3817,6 @@ struct QRegExpPrivate }; #if !defined(QT_NO_REGEXP_OPTIM) -uint qHash(const QRegExpEngineKey &key, uint seed = 0) Q_DECL_NOTHROW -{ - return qHash(key.pattern, seed); -} - typedef QCache<QRegExpEngineKey, QRegExpEngine> EngineCache; Q_GLOBAL_STATIC(EngineCache, globalEngineCache) static QBasicMutex globalEngineCacheMutex; @@ -4033,6 +4038,21 @@ bool QRegExp::operator==(const QRegExp &rx) const } /*! + \since 5.6 + \relates QRegExp + + Returns the hash value for \a key, using + \a seed to seed the calculation. +*/ +uint qHash(const QRegExp &key, uint seed) Q_DECL_NOTHROW +{ + QtPrivate::QHashCombine hash; + seed = hash(seed, key.priv->engineKey); + seed = hash(seed, key.priv->minimal); + return seed; +} + +/*! \fn bool QRegExp::operator!=(const QRegExp &rx) const Returns \c true if this regular expression is not equal to \a rx; |