QHash: remove optimization for QHash<int, T>
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Fri, 13 Apr 2012 17:59:58 +0000 (18:59 +0100)
committerQt by Nokia <qt-info@nokia.com>
Sat, 14 Apr 2012 13:49:16 +0000 (15:49 +0200)
commitc2293c897c9f2e35dffec777c19577c0f6052e81
treed64222df4200f01833bde36f41184f11ff19ce9f
parent5e24d22af075ce790b471fb9aca59a80037f34df
QHash: remove optimization for QHash<int, T>

QHash employs an optimization for int/uints, squashing the hash
value and the key value inside an union. This obviously works
iff qHash(int k) = k. If the hash value gets salted, the hash
table is corrupted.

This patch removes that optimization by means of a #if 0,
so if further research finds out that we want those 4 bytes back
it's pretty simple to revert.

Change-Id: If273f0bf2ff007f4f2f7c46d2aab364a3b455cf1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
src/corelib/tools/qhash.h