diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index a2d9434904..55c3efa307 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -879,8 +879,13 @@ Q_OUTOFLINE_TEMPLATE typename QHash::Node **QHash::findNode(cons uint *ahp) const { Node **node; - uint h = qHash(akey); + uint h; + if (d->numBuckets || ahp) { + h = qHash(akey); + if (ahp) + *ahp = h; + } if (d->numBuckets) { node = reinterpret_cast(&d->buckets[h % d->numBuckets]); Q_ASSERT(*node == e || (*node)->next); @@ -889,8 +894,6 @@ Q_OUTOFLINE_TEMPLATE typename QHash::Node **QHash::findNode(cons } else { node = const_cast(reinterpret_cast(&e)); } - if (ahp) - *ahp = h; return node; }