summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h')
-rw-r--r--tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h47
1 files changed, 17 insertions, 30 deletions
diff --git a/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h b/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h
index eca4b61d58..501b4a8b7f 100644
--- a/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h
+++ b/tests/benchmarks/corelib/tools/qhash/tst_bench_qhash.h
@@ -1,33 +1,20 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtTest module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+#include <QHashFunctions>
#include <QString>
+struct OwningLatin1String : QByteArray
+{
+ OwningLatin1String() = default;
+ OwningLatin1String(const QByteArray &a) : QByteArray(a) {}
+ OwningLatin1String(QByteArray &&a) : QByteArray(std::move(a)) {}
+};
+QT_BEGIN_NAMESPACE
+inline size_t qHash(const OwningLatin1String &s, size_t seed = 0)
+{ return qHash(QLatin1StringView(s), seed); }
+QT_END_NAMESPACE
+
struct Qt4String : QString
{
Qt4String() {}
@@ -35,7 +22,7 @@ struct Qt4String : QString
};
QT_BEGIN_NAMESPACE
-uint qHash(const Qt4String &);
+size_t qHash(const Qt4String &, size_t = 0);
QT_END_NAMESPACE
struct Qt50String : QString
@@ -45,7 +32,7 @@ struct Qt50String : QString
};
QT_BEGIN_NAMESPACE
-uint qHash(const Qt50String &, uint seed = 0);
+size_t qHash(const Qt50String &, size_t seed = 0);
QT_END_NAMESPACE
@@ -56,6 +43,6 @@ struct JavaString : QString
};
QT_BEGIN_NAMESPACE
-uint qHash(const JavaString &);
+size_t qHash(const JavaString &, size_t = 0);
QT_END_NAMESPACE