From 07703ade86edcd6565c373f63e34306209d1a90a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 9 Apr 2008 13:04:02 +0200 Subject: don't detach in qHash() Signed-off-by: Thiago Macieira --- src/corelib/tools/qhash.cpp | 4 ++-- 1 file 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(key.data()), key.size()); + return hash(reinterpret_cast(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(bitArray.d.data()), qMax(0, m)); + uint result = hash(reinterpret_cast(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 -- cgit v0.12