summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2008-04-09 11:04:02 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2009-04-20 15:21:17 (GMT)
commit07703ade86edcd6565c373f63e34306209d1a90a (patch)
treec732eb5cc5799784b8f4ce14913546920e087fc6
parentd7072b5577e3c07e984885cf05d5f9b217c6f473 (diff)
downloadQt-07703ade86edcd6565c373f63e34306209d1a90a.zip
Qt-07703ade86edcd6565c373f63e34306209d1a90a.tar.gz
Qt-07703ade86edcd6565c373f63e34306209d1a90a.tar.bz2
don't detach in qHash()
Signed-off-by: Thiago Macieira <thiago.macieira@nokia.com>
-rw-r--r--src/corelib/tools/qhash.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index 540f43d..21d98b5 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -91,7 +91,7 @@ static uint hash(const QChar *p, int n)
uint qHash(const QByteArray &key)
{
- return hash(reinterpret_cast<const uchar *>(key.data()), key.size());
+ return hash(reinterpret_cast<const uchar *>(key.constData()), key.size());
}
uint qHash(const QString &key)
@@ -107,7 +107,7 @@ uint qHash(const QStringRef &key)
uint qHash(const QBitArray &bitArray)
{
int m = bitArray.d.size() - 1;
- uint result = hash(reinterpret_cast<const uchar *>(bitArray.d.data()), qMax(0, m));
+ uint result = hash(reinterpret_cast<const uchar *>(bitArray.d.constData()), qMax(0, m));
// deal with the last 0 to 7 bits manually, because we can't trust that
// the padding is initialized to 0 in bitArray.d