summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qdatetime.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-08-02 15:51:52 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-20 21:59:21 +0200
commit373845dfd8acae0c941432c8cd615b77bcae0a2a (patch)
treed8d88bdd6657a18f55456bfe2ac5dfff682e76aa /src/corelib/tools/qdatetime.cpp
parent291938aea6771a0ce4c11a164583a73c6eef026e (diff)
Add Q_DECL_NOTHROW to some qHash functions
The hashing functions for QDateTime and QHostAddress did not get the noexcept keyword because they might allocate memory. QDateTime doesn't do it now, but it could in the future. QHostAddress does allocate memory today. Change-Id: Ia5f80942944bfc2b8c405306c467bfd88ef0e48c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qdatetime.cpp')
-rw-r--r--src/corelib/tools/qdatetime.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 8c9944b001..162117602b 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -4097,7 +4097,7 @@ uint qHash(const QDateTime &key, uint seed)
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
-uint qHash(const QDate &key, uint seed)
+uint qHash(const QDate &key, uint seed) Q_DECL_NOTHROW
{
return qHash(key.toJulianDay(), seed);
}
@@ -4108,9 +4108,9 @@ uint qHash(const QDate &key, uint seed)
Returns the hash value for the \a key, using \a seed to seed the calculation.
*/
-uint qHash(const QTime &key, uint seed)
+uint qHash(const QTime &key, uint seed) Q_DECL_NOTHROW
{
- return QTime(0, 0, 0, 0).msecsTo(key) ^ seed;
+ return qHash(QTime(0, 0, 0, 0).msecsTo(key), seed);
}
#ifndef QT_BOOTSTRAPPED