diff options
author | Robin Burchell <robin+qt@viroteck.net> | 2012-02-28 20:56:14 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-29 22:39:00 +0100 |
commit | 1f4804452c05c57308979bf090305c7c882f92c9 (patch) | |
tree | 9b95efd8dee3081008e22867b753f2ebc0d64507 /tests/benchmarks/corelib/tools/qhash/main.h | |
parent | 57004b7fda861e1e59a00688a859f30d9a088b4e (diff) |
Copy Qt 4's QString hash algorithm.
We must do this the same way we do all other hash algorithms for fair
comparison, as otherwise, the call to the PLT unfairly penalises
QHash<QString>'s results, as it's in a different shared object.
Change-Id: I69c891f5a97dcccdfcfbdbf32796f86242a42963
Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/benchmarks/corelib/tools/qhash/main.h')
-rw-r--r-- | tests/benchmarks/corelib/tools/qhash/main.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/benchmarks/corelib/tools/qhash/main.h b/tests/benchmarks/corelib/tools/qhash/main.h index c4cf94e190..3d193b5e40 100644 --- a/tests/benchmarks/corelib/tools/qhash/main.h +++ b/tests/benchmarks/corelib/tools/qhash/main.h @@ -41,6 +41,17 @@ #include <QString> +struct Qt4String : QString +{ + Qt4String() {} + Qt4String(const QString &s) : QString(s) {} +}; + +QT_BEGIN_NAMESPACE +uint qHash(const Qt4String &); +QT_END_NAMESPACE + + struct String : QString { String() {} |